Simplify read_vchars since it's always stored in little endian.

This commit is contained in:
Con Kolivas 2011-03-21 13:33:45 +11:00
parent 81bdbaf066
commit 19cbaaf8df

View file

@ -65,12 +65,8 @@ static inline i64 read_vchars(rzip_control *control, void *ss, int stream, int l
int bytes; int bytes;
i64 s = 0; i64 s = 0;
for (bytes = 0; bytes < length; bytes++) { if (unlikely(read_stream(control, ss, stream, (uchar *)&s, length) != length))
int bits = bytes * 8; fatal("Stream read of %d bytes failed\n", length);
uchar sb = read_u8(control, ss, stream);
s |= (i64)sb << bits;
}
s = le64toh(s); s = le64toh(s);
return s; return s;
} }