@@ -231,11 +231,10 @@ class _ReviverJsonListener extends _BuildJsonListener {
231
231
* These are all ASCII, so an [Uint8List] is used as backing store.
232
232
*
233
233
* This buffer is used when a JSON number is split between separate chunks.
234
- *
235
234
*/
236
235
class _NumberBuffer {
237
236
static const int minCapacity = 16 ;
238
- static const int kDefaultOverhead = 5 ;
237
+ static const int defaultOverhead = 5 ;
239
238
Uint8List list;
240
239
int length = 0 ;
241
240
_NumberBuffer (int initialCapacity)
@@ -246,12 +245,14 @@ class _NumberBuffer {
246
245
// Pick an initial capacity greater than the first part's size.
247
246
// The typical use case has two parts, this is the attempt at
248
247
// guessing the size of the second part without overdoing it.
249
- // The default estimate of the second part is [kDefaultOverhead ],
248
+ // The default estimate of the second part is [defaultOverhead ],
250
249
// then round to multiplum of four, and return the result,
251
250
// or [minCapacity] if that is greater.
252
251
static int _initialCapacity (int minCapacity) {
253
- minCapacity += kDefaultOverhead;
254
- if (minCapacity < minCapacity) return minCapacity;
252
+ minCapacity += defaultOverhead;
253
+ if (minCapacity < _NumberBuffer .minCapacity) {
254
+ return _NumberBuffer .minCapacity;
255
+ }
255
256
minCapacity = (minCapacity + 3 ) & ~ 3 ; // Round to multiple of four.
256
257
return minCapacity;
257
258
}
@@ -1214,7 +1215,7 @@ abstract class _ChunkedJsonParser<T> {
1214
1215
// Continues an already chunked number across an entire chunk.
1215
1216
int continueChunkNumber (int state, int start, _NumberBuffer buffer) {
1216
1217
int end = chunkEnd;
1217
- addNumberChunk (buffer, start, end, _NumberBuffer .kDefaultOverhead );
1218
+ addNumberChunk (buffer, start, end, _NumberBuffer .defaultOverhead );
1218
1219
this .buffer = buffer;
1219
1220
this .partialState = PARTIAL_NUMERAL | state;
1220
1221
return end;
0 commit comments