File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/node_modules/pouchdb-core/src Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -598,8 +598,7 @@ class AbstractPouchDB extends EventEmitter {
598598
599599 for ( var i = 0 ; i < paths . length ; i ++ ) {
600600 var currentPath = paths [ i ] ;
601- var hashIndex = currentPath . ids . map ( function ( x ) { return x . id ; } )
602- . indexOf ( revHash ) ;
601+ const hashIndex = currentPath . ids . findIndex ( x => x . id === revHash ) ;
603602 var hashFoundAtRevPos = hashIndex === ( revNo - 1 ) ;
604603
605604 if ( hashFoundAtRevPos || ( ! path && hashIndex !== - 1 ) ) {
@@ -614,8 +613,8 @@ class AbstractPouchDB extends EventEmitter {
614613 return cb ( err ) ;
615614 }
616615
617- var indexOfRev = path . ids . map ( function ( x ) { return x . id ; } )
618- . indexOf ( doc . _rev . split ( '-' ) [ 1 ] ) + 1 ;
616+ const pathId = doc . _rev . split ( '-' ) [ 1 ] ;
617+ const indexOfRev = path . ids . findIndex ( x => x . id === pathId ) + 1 ;
619618 var howMany = path . ids . length - indexOfRev ;
620619 path . ids . splice ( indexOfRev , howMany ) ;
621620 path . ids . reverse ( ) ;
You can’t perform that action at this time.
0 commit comments