File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 11
11
stackRestore
12
12
stackSave
13
13
UTF8ToString
14
- stringToUTF8
15
- lengthBytesUTF8
14
+ stringToNewUTF8
16
15
allocateUTF8OnStack
17
16
removeFunction
18
17
addFunction
@@ -543,14 +542,13 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
543
542
pos = this . pos ;
544
543
this . pos += 1 ;
545
544
}
546
- var length = lengthBytesUTF8 ( string ) ;
547
545
var strptr = stringToNewUTF8 ( string ) ;
548
546
this . allocatedmem . push ( strptr ) ;
549
547
this . db . handleError ( sqlite3_bind_text (
550
548
this . stmt ,
551
549
pos ,
552
550
strptr ,
553
- length - 1 ,
551
+ - 1 ,
554
552
0
555
553
) ) ;
556
554
return true ;
@@ -733,12 +731,10 @@ Module["onRuntimeInitialized"] = function onRuntimeInitialized() {
733
731
*/
734
732
function StatementIterator ( sql , db ) {
735
733
this . db = db ;
736
- var sz = lengthBytesUTF8 ( sql ) + 1 ;
737
- this . sqlPtr = _malloc ( sz ) ;
734
+ this . sqlPtr = stringToNewUTF8 ( sql ) ;
738
735
if ( this . sqlPtr === null ) {
739
736
throw new Error ( "Unable to allocate memory for the SQL string" ) ;
740
737
}
741
- stringToUTF8 ( sql , this . sqlPtr , sz ) ;
742
738
this . nextSqlPtr = this . sqlPtr ;
743
739
this . nextSqlString = null ;
744
740
this . activeStatement = null ;
You can’t perform that action at this time.
0 commit comments