Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
3c5f589f
Commit
3c5f589f
authored
6 months ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: used to panic in pico.raft_log sometimes
parent
ed5a4139
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1235
use config version to trigger replication configuration instead of state Replicated
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/luamod.rs
+11
-2
11 additions, 2 deletions
src/luamod.rs
with
11 additions
and
2 deletions
src/luamod.rs
+
11
−
2
View file @
3c5f589f
...
...
@@ -937,6 +937,7 @@ pub(crate) fn setup() {
if
first
{
first
=
false
;
start
=
token
.start
;
end
=
token
.start
;
}
else
{
// also count the spaces between this and previous token
added_chars
+=
token
.start
-
prev_token
.end
;
...
...
@@ -947,20 +948,28 @@ pub(crate) fn setup() {
// and make an ugly row. We could subdivide such tokens
// even further, but I don't want to make this code
// even more complicated than it already is...
if
utf8_len
+
added_chars
>
cw
&&
start
!=
end
{
let
new_token_will_overflow
=
utf8_len
+
added_chars
>
cw
;
let
added_at_least_one_token
=
start
!=
end
;
if
new_token_will_overflow
&&
added_at_least_one_token
{
break
;
}
// FIXME the depth should not be modified if we're not adding the token
match
token
.text
{
"("
=>
paren_depth
+=
1
,
")"
=>
paren_depth
-=
1
,
_
=>
{}
}
if
args_on_separate_rows
&&
paren_depth
==
0
&&
token
.text
==
")"
{
if
args_on_separate_rows
&&
added_at_least_one_token
&&
paren_depth
==
0
&&
token
.text
==
")"
{
break
;
}
// At this point the new token is added to the current piece
utf8_len
+=
added_chars
;
end
=
token
.end
;
_
=
lexer
.next_token
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment