File tree Expand file tree Collapse file tree 6 files changed +185
-188
lines changed Expand file tree Collapse file tree 6 files changed +185
-188
lines changed Original file line number Diff line number Diff line change 29
29
var largeArraySize = 75 ;
30
30
31
31
/** Used as the max size of the `arrayPool` and `objectPool` */
32
- var maxPoolSize = 10 ;
32
+ var maxPoolSize = 40 ;
33
33
34
34
/** Used to match empty string literals in compiled template source */
35
35
var reEmptyStringLeading = / \b _ _ p \+ = ' ' ; / g,
328
328
'args' : '' ,
329
329
'array' : null ,
330
330
'bottom' : '' ,
331
+ 'cache' : null ,
331
332
'criteria' : null ,
332
333
'false' : false ,
333
334
'firstArg' : '' ,
381
382
* @param {Array } [array] The array to release.
382
383
*/
383
384
function releaseArray ( array ) {
384
- if ( arrayPool . length == maxPoolSize ) {
385
- arrayPool . length = maxPoolSize - 1 ;
386
- }
387
385
array . length = 0 ;
388
- arrayPool . push ( array ) ;
386
+ if ( arrayPool . length < maxPoolSize ) {
387
+ arrayPool . push ( array ) ;
388
+ }
389
389
}
390
390
391
391
/**
399
399
if ( cache ) {
400
400
releaseObject ( cache ) ;
401
401
}
402
- if ( objectPool . length == maxPoolSize ) {
403
- objectPool . length = maxPoolSize - 1 ;
404
- }
405
402
object . array = object . cache = object . criteria = object . object = object . number = object . string = object . value = null ;
406
- objectPool . push ( object ) ;
403
+ if ( objectPool . length < maxPoolSize ) {
404
+ objectPool . push ( object ) ;
405
+ }
407
406
}
408
407
409
408
/**
Original file line number Diff line number Diff line change 29
29
var largeArraySize = 75 ;
30
30
31
31
/** Used as the max size of the `arrayPool` and `objectPool` */
32
- var maxPoolSize = 10 ;
32
+ var maxPoolSize = 40 ;
33
33
34
34
/** Used to match empty string literals in compiled template source */
35
35
var reEmptyStringLeading = / \b _ _ p \+ = ' ' ; / g,
320
320
function getObject ( ) {
321
321
return objectPool . pop ( ) || {
322
322
'array' : null ,
323
+ 'cache' : null ,
323
324
'criteria' : null ,
324
325
'false' : false ,
325
326
'index' : 0 ,
353
354
* @param {Array } [array] The array to release.
354
355
*/
355
356
function releaseArray ( array ) {
356
- if ( arrayPool . length == maxPoolSize ) {
357
- arrayPool . length = maxPoolSize - 1 ;
358
- }
359
357
array . length = 0 ;
360
- arrayPool . push ( array ) ;
358
+ if ( arrayPool . length < maxPoolSize ) {
359
+ arrayPool . push ( array ) ;
360
+ }
361
361
}
362
362
363
363
/**
371
371
if ( cache ) {
372
372
releaseObject ( cache ) ;
373
373
}
374
- if ( objectPool . length == maxPoolSize ) {
375
- objectPool . length = maxPoolSize - 1 ;
376
- }
377
374
object . array = object . cache = object . criteria = object . object = object . number = object . string = object . value = null ;
378
- objectPool . push ( object ) ;
375
+ if ( objectPool . length < maxPoolSize ) {
376
+ objectPool . push ( object ) ;
377
+ }
379
378
}
380
379
381
380
/**
You can’t perform that action at this time.
0 commit comments