Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
02b4d074
Commit
02b4d074
authored
Sep 07, 2017
by
Fiisio
Committed by
Felix Lange
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/asm: use ContainsRune instead of IndexRune (#15098)
parent
2dcb22af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
lexer.go
core/asm/lexer.go
+3
-3
No files found.
core/asm/lexer.go
View file @
02b4d074
...
@@ -145,7 +145,7 @@ func (l *lexer) ignore() {
...
@@ -145,7 +145,7 @@ func (l *lexer) ignore() {
// Accepts checks whether the given input matches the next rune
// Accepts checks whether the given input matches the next rune
func
(
l
*
lexer
)
accept
(
valid
string
)
bool
{
func
(
l
*
lexer
)
accept
(
valid
string
)
bool
{
if
strings
.
IndexRune
(
valid
,
l
.
next
())
>=
0
{
if
strings
.
ContainsRune
(
valid
,
l
.
next
())
{
return
true
return
true
}
}
...
@@ -157,7 +157,7 @@ func (l *lexer) accept(valid string) bool {
...
@@ -157,7 +157,7 @@ func (l *lexer) accept(valid string) bool {
// acceptRun will continue to advance the seeker until valid
// acceptRun will continue to advance the seeker until valid
// can no longer be met.
// can no longer be met.
func
(
l
*
lexer
)
acceptRun
(
valid
string
)
{
func
(
l
*
lexer
)
acceptRun
(
valid
string
)
{
for
strings
.
IndexRune
(
valid
,
l
.
next
())
>=
0
{
for
strings
.
ContainsRune
(
valid
,
l
.
next
())
{
}
}
l
.
backup
()
l
.
backup
()
}
}
...
@@ -166,7 +166,7 @@ func (l *lexer) acceptRun(valid string) {
...
@@ -166,7 +166,7 @@ func (l *lexer) acceptRun(valid string) {
// to advance the seeker until the rune has been found.
// to advance the seeker until the rune has been found.
func
(
l
*
lexer
)
acceptRunUntil
(
until
rune
)
bool
{
func
(
l
*
lexer
)
acceptRunUntil
(
until
rune
)
bool
{
// Continues running until a rune is found
// Continues running until a rune is found
for
i
:=
l
.
next
();
strings
.
IndexRune
(
string
(
until
),
i
)
==
-
1
;
i
=
l
.
next
()
{
for
i
:=
l
.
next
();
!
strings
.
ContainsRune
(
string
(
until
),
i
)
;
i
=
l
.
next
()
{
if
i
==
0
{
if
i
==
0
{
return
false
return
false
}
}
...
...
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