Check-in [e9b80a705b]
Overview
Comment:Fixed a nasty variable shadowing bug :)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | decompressor2
Files: files | file ages | folders
SHA1: e9b80a705b5a33794ac97bbab1ebe797a98be8d6
User & Date: spaskalev on 2014-12-22 15:34:13
Other Links: branch diff | manifest | tags
Context
2014-12-22
16:35
Decompressor - try to fill as much as possible in the output buffer in a single pass. Closed-Leaf check-in: 42ba1f458d user: spaskalev tags: decompressor2
15:34
Fixed a nasty variable shadowing bug :) check-in: e9b80a705b user: spaskalev tags: decompressor2
14:23
Read available bytes and the end of the buffer and decompress in a singe pass check-in: ae0940d072 user: spaskalev tags: decompressor2
Changes

Modified src/0dev.org/predictor/predictor.go from [c018a46296] to [219e9c8a2d].

163
164
165
166
167
168
169
170
171
172



173
174
175
176
177
178
179
163
164
165
166
167
168
169



170
171
172
173
174
175
176
177
178
179







-
-
-
+
+
+







		available = 8 - predicted

		// Read the non-predicted bytes and place them in the end of the buffer
		rc, err = reader.Read(ctx.input[predicted:])
	retryData:
		if rc < int(available) && err == nil {
			// Retry the read if we have fewer bytes than what the prediction header indicates
			var rc int
			rc, err = reader.Read(ctx.input[predicted+rc:])
			rc += rc
			var r int
			r, err = reader.Read(ctx.input[predicted+rc:])
			rc += r
			goto retryData
		} // Continue on any error, try to decompress and return it along the result

		// Walk the buffer, filling in the predicted blanks,
		// relocating read bytes and and updating the guess table
		for i, a := uint(0), predicted; i < 8; i++ {
			if (flags & (1 << i)) > 0 {