##// END OF EJS Templates
bundle2: inline struct operations...
Gregory Szorc -
r35116:764e3ad1 default
parent child Browse files
Show More
@@ -1196,11 +1196,14 b' def decodepayloadchunks(ui, fh):'
1196 dolog = ui.configbool('devel', 'bundle2.debug')
1196 dolog = ui.configbool('devel', 'bundle2.debug')
1197 debug = ui.debug
1197 debug = ui.debug
1198
1198
1199 headersize = struct.calcsize(_fpayloadsize)
1199 headerstruct = struct.Struct(_fpayloadsize)
1200 headersize = headerstruct.size
1201 unpack = headerstruct.unpack
1202
1200 readexactly = changegroup.readexactly
1203 readexactly = changegroup.readexactly
1201 read = fh.read
1204 read = fh.read
1202
1205
1203 chunksize = _unpack(_fpayloadsize, readexactly(fh, headersize))[0]
1206 chunksize = unpack(readexactly(fh, headersize))[0]
1204 indebug(ui, 'payload chunk size: %i' % chunksize)
1207 indebug(ui, 'payload chunk size: %i' % chunksize)
1205
1208
1206 # changegroup.readexactly() is inlined below for performance.
1209 # changegroup.readexactly() is inlined below for performance.
@@ -1227,7 +1230,7 b' def decodepayloadchunks(ui, fh):'
1227 ' (got %d bytes, expected %d)') %
1230 ' (got %d bytes, expected %d)') %
1228 (len(s), chunksize))
1231 (len(s), chunksize))
1229
1232
1230 chunksize = _unpack(_fpayloadsize, s)[0]
1233 chunksize = unpack(s)[0]
1231
1234
1232 # indebug() inlined for performance.
1235 # indebug() inlined for performance.
1233 if dolog:
1236 if dolog:
General Comments 0
You need to be logged in to leave comments. Login now