aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-04-11 19:01:08 +0000
committerdrh <drh@noemail.net>2016-04-11 19:01:08 +0000
commit244b9d6ec67e84815d2f473b222b0dcb3ca657b3 (patch)
treee80c6c82bdbacd0fc401a1d3d6a936bcd47becaa /src/util.c
parentaffa855c94167e78b10d8b3bdbc1950aa30e695d (diff)
downloadsqlite-244b9d6ec67e84815d2f473b222b0dcb3ca657b3.tar.gz
sqlite-244b9d6ec67e84815d2f473b222b0dcb3ca657b3.zip
Performance optimization to sqlite3Dequote() and its callers.
FossilOrigin-Name: 9efe2265b1e70172778d333c5b9d9a76095427ab
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/util.c b/src/util.c
index d2c6ec8e8..2f77a6033 100644
--- a/src/util.c
+++ b/src/util.c
@@ -242,18 +242,13 @@ void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
** brackets from around identifiers. For example: "[a-b-c]" becomes
** "a-b-c".
*/
-int sqlite3Dequote(char *z){
+void sqlite3Dequote(char *z){
char quote;
int i, j;
- if( z==0 ) return -1;
+ if( z==0 ) return;
quote = z[0];
- switch( quote ){
- case '\'': break;
- case '"': break;
- case '`': break; /* For MySQL compatibility */
- case '[': quote = ']'; break; /* For MS SqlServer compatibility */
- default: return -1;
- }
+ if( !sqlite3Isquote(quote) ) return;
+ if( quote=='[' ) quote = ']';
for(i=1, j=0;; i++){
assert( z[i] );
if( z[i]==quote ){
@@ -268,7 +263,6 @@ int sqlite3Dequote(char *z){
}
}
z[j] = 0;
- return j;
}
/*