/ Check-in [6538ef7b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor optimization to sqlite3VdbeMemSetStr().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:6538ef7b6b56c7a6629a0bb7418910c64c8b2e73af2296a116c073ecf2e0d429
User & Date: drh 2017-08-21 02:05:22
Context
2017-08-21
02:20
Remove an unnecessary conditional. check-in: 56d19f9f user: drh tags: trunk
02:05
Minor optimization to sqlite3VdbeMemSetStr(). check-in: 6538ef7b user: drh tags: trunk
2017-08-19
20:38
Space and size optimization to the printf implementation. check-in: d01d2cff user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
  }else{
    iLimit = SQLITE_MAX_LENGTH;
  }
  flags = (enc==0?MEM_Blob:MEM_Str);
  if( nByte<0 ){
    assert( enc!=0 );
    if( enc==SQLITE_UTF8 ){
      nByte = sqlite3Strlen30(z);
      if( nByte>iLimit ) nByte = iLimit+1;
    }else{
      for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
    }
    flags |= MEM_Term;
  }








|







927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
  }else{
    iLimit = SQLITE_MAX_LENGTH;
  }
  flags = (enc==0?MEM_Blob:MEM_Str);
  if( nByte<0 ){
    assert( enc!=0 );
    if( enc==SQLITE_UTF8 ){
      nByte = 0x7fffffff & (int)strlen(z);
      if( nByte>iLimit ) nByte = iLimit+1;
    }else{
      for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){}
    }
    flags |= MEM_Term;
  }