Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-sapl
Commits
d6ce036a
Commit
d6ce036a
authored
Feb 29, 2016
by
Laszlo Domoszlai
Browse files
avoid array creation in matchAt
parent
d95d5e65
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Sapl/FastString.icl
View file @
d6ce036a
...
...
@@ -58,7 +58,10 @@ matchAt :: !String !String !Int -> Bool
matchAt
s1
s2
p
|
((
size
s1
)
+
p
)
>
(
size
s2
)
=
False
=
and
[
s1
.[
i
]
==
s2
.[
p
+
i
]
\\
i
<-
[
0
..((
size
s1
)
-
1
)]]
=
eqS
((
size
s1
)
-
1
)
where
eqS
0
=
s1
.[
0
]
==
s2
.[
p
+
0
]
eqS
i
=
s1
.[
i
]
==
s2
.[
p
+
i
]
&&
eqS
(
i
-
1
)
countCharBackwards
::
!
Char
!
String
->
Int
countCharBackwards
chr
str
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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