@@ -27,24 +27,24 @@ function print () {
2727
2828const run = CHAINED
2929 ? function ( ) {
30- const batch = db . batch ( )
30+ const batch = db . batch ( )
3131
32- for ( let i = 0 ; i < 100 ; i ++ ) {
33- let key = 'long key to test memory usage ' + String ( Math . floor ( Math . random ( ) * 10000000 ) )
34- if ( BUFFERS ) key = Buffer . from ( key )
35- let value = crypto . randomBytes ( 1024 )
36- if ( ! BUFFERS ) value = value . toString ( 'hex' )
37- batch . put ( key , value )
38- }
32+ for ( let i = 0 ; i < 100 ; i ++ ) {
33+ let key = 'long key to test memory usage ' + String ( Math . floor ( Math . random ( ) * 10000000 ) )
34+ if ( BUFFERS ) key = Buffer . from ( key )
35+ let value = crypto . randomBytes ( 1024 )
36+ if ( ! BUFFERS ) value = value . toString ( 'hex' )
37+ batch . put ( key , value )
38+ }
3939
40- batch . write ( function ( err ) {
41- assert ( ! err )
42- process . nextTick ( run )
43- } )
40+ batch . write ( function ( err ) {
41+ assert ( ! err )
42+ process . nextTick ( run )
43+ } )
4444
45- writeCount ++
46- print ( )
47- }
45+ writeCount ++
46+ print ( )
47+ }
4848 : function ( ) {
4949 const batch = [ ]
5050
@@ -53,7 +53,7 @@ const run = CHAINED
5353 if ( BUFFERS ) key = Buffer . from ( key )
5454 let value = crypto . randomBytes ( 1024 )
5555 if ( ! BUFFERS ) value = value . toString ( 'hex' )
56- batch . push ( { type : 'put' , key : key , value : value } )
56+ batch . push ( { type : 'put' , key, value } )
5757 }
5858
5959 db . batch ( batch , function ( err ) {
0 commit comments