[tracker/rss-enclosures] SPARQL: Improve lexer performance for strings with ASCII characters
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] SPARQL: Improve lexer performance for strings with ASCII characters
- Date: Wed, 24 Nov 2010 01:21:47 +0000 (UTC)
commit 2cf633d38f08f4b16d3811d154d469b001461a04
Author: Jürg Billeter <j bitron ch>
Date: Tue Aug 17 11:14:32 2010 +0200
SPARQL: Improve lexer performance for strings with ASCII characters
src/libtracker-data/tracker-sparql-scanner.vala | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql-scanner.vala b/src/libtracker-data/tracker-sparql-scanner.vala
index 7ba8ea1..d216ac0 100644
--- a/src/libtracker-data/tracker-sparql-scanner.vala
+++ b/src/libtracker-data/tracker-sparql-scanner.vala
@@ -645,6 +645,10 @@ public class Tracker.SparqlScanner : Object {
line++;
column = 1;
token_length_in_chars = 3;
+ } else if (current[0] <= 0x7f) {
+ // ASCII
+ current++;
+ token_length_in_chars++;
} else {
unichar u = ((string) current).get_char_validated ((long) (end - current));
if (u != (unichar) (-1)) {
@@ -696,6 +700,10 @@ public class Tracker.SparqlScanner : Object {
}
} else if (current[0] == '\n') {
break;
+ } else if (current[0] <= 0x7f) {
+ // ASCII
+ current++;
+ token_length_in_chars++;
} else {
unichar u = ((string) current).get_char_validated ((long) (end - current));
if (u != (unichar) (-1)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]