Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
92833475
Commit
92833475
authored
Jun 18, 2004
by
bar@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctype-uca.c:
Code optimization to make it look better and work faster.
parent
efc2936e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
28 deletions
+35
-28
strings/ctype-uca.c
strings/ctype-uca.c
+35
-28
No files found.
strings/ctype-uca.c
View file @
92833475
...
@@ -7473,55 +7473,62 @@ static int ch2x(int ch)
...
@@ -7473,55 +7473,62 @@ static int ch2x(int ch)
static
my_coll_lexem_num
my_coll_lexem_next
(
MY_COLL_LEXEM
*
lexem
)
static
my_coll_lexem_num
my_coll_lexem_next
(
MY_COLL_LEXEM
*
lexem
)
{
{
for
(
;
lexem
->
beg
<
lexem
->
end
;
lexem
->
beg
++
)
const
char
*
beg
;
my_coll_lexem_num
rc
;
for
(
beg
=
lexem
->
beg
;
beg
<
lexem
->
end
;
beg
++
)
{
{
lexem
->
prev
=
lexem
->
beg
;
if
(
*
beg
==
' '
||
*
beg
==
'\t'
||
*
beg
==
'\r'
||
*
beg
==
'\n'
)
if
(
lexem
->
beg
[
0
]
==
' '
||
lexem
->
beg
[
0
]
==
'\t'
||
lexem
->
beg
[
0
]
==
'\r'
||
lexem
->
beg
[
0
]
==
'\n'
)
continue
;
continue
;
if
(
lexem
->
beg
[
0
]
==
'&'
)
if
(
*
beg
==
'&'
)
{
{
lexem
->
beg
++
;
beg
++
;
return
MY_COLL_LEXEM_SHIFT
;
rc
=
MY_COLL_LEXEM_SHIFT
;
goto
ex
;
}
}
if
(
lexem
->
beg
[
0
]
==
'<'
)
if
(
beg
[
0
]
==
'<'
)
{
{
for
(
lexem
->
beg
++
,
lexem
->
diff
=
1
;
for
(
beg
++
,
lexem
->
diff
=
1
;
(
lexem
->
beg
<
lexem
->
end
)
&&
(
beg
<
lexem
->
end
)
&&
(
lexem
->
beg
[
0
]
==
'<'
)
&&
(
lexem
->
diff
<
3
);
(
*
beg
==
'<'
)
&&
(
lexem
->
diff
<
3
);
lexem
->
beg
++
,
lexem
->
diff
++
);
beg
++
,
lexem
->
diff
++
);
return
MY_COLL_LEXEM_DIFF
;
rc
=
MY_COLL_LEXEM_DIFF
;
goto
ex
;
}
}
if
((
lexem
->
beg
[
0
]
>=
'a'
&&
lexem
->
beg
[
0
]
<=
'z'
)
||
if
((
*
beg
>=
'a'
&&
*
beg
<=
'z'
)
||
(
*
beg
>=
'A'
&&
*
beg
<=
'Z'
))
(
lexem
->
beg
[
0
]
>=
'A'
&&
lexem
->
beg
[
0
]
<=
'Z'
))
{
{
lexem
->
code
=
lexem
->
beg
[
0
]
;
lexem
->
code
=
*
beg
++
;
lexem
->
beg
++
;
rc
=
MY_COLL_LEXEM_CHAR
;
return
MY_COLL_LEXEM_CHAR
;
goto
ex
;
}
}
if
((
lexem
->
beg
[
0
]
==
'\\'
)
&&
if
((
*
beg
==
'\\'
)
&&
(
beg
+
2
<
lexem
->
end
)
&&
(
beg
[
1
]
==
'u'
))
(
lexem
->
beg
+
2
<
lexem
->
end
)
&&
(
lexem
->
beg
[
1
]
==
'u'
))
{
{
int
ch
;
int
ch
;
beg
+=
2
;
lexem
->
code
=
0
;
lexem
->
code
=
0
;
for
(
lexem
->
beg
+=
2
;
while
((
beg
<
lexem
->
end
)
&&
((
ch
=
ch2x
(
beg
[
0
]))
>=
0
))
(
lexem
->
beg
<
lexem
->
end
)
&&
((
ch
=
ch2x
(
lexem
->
beg
[
0
]))
>=
0
)
;
lexem
->
beg
++
)
{
{
lexem
->
code
=
(
lexem
->
code
<<
4
)
+
ch
;
lexem
->
code
=
(
lexem
->
code
<<
4
)
+
ch
;
beg
++
;
}
}
return
MY_COLL_LEXEM_CHAR
;
rc
=
MY_COLL_LEXEM_CHAR
;
goto
ex
;
}
}
return
MY_COLL_LEXEM_ERROR
;
rc
=
MY_COLL_LEXEM_ERROR
;
goto
ex
;
}
}
return
MY_COLL_LEXEM_EOF
;
rc
=
MY_COLL_LEXEM_EOF
;
ex:
lexem
->
prev
=
lexem
->
beg
;
lexem
->
beg
=
beg
;
return
rc
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment