Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f7696d50
Commit
f7696d50
authored
Aug 25, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clearer computation of gap size
parent
4a226bf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
app/services/issue_rebalancing_service.rb
app/services/issue_rebalancing_service.rb
+3
-2
No files found.
app/services/issue_rebalancing_service.rb
View file @
f7696d50
...
...
@@ -23,12 +23,13 @@ class IssueRebalancingService
raise
TooManyIssues
,
"
#{
n
}
issues"
end
range
=
RelativePositioning
::
MAX_POSITION
-
RelativePositioning
::
MIN_POSITION
gaps
=
n
-
1
gap_size
=
0
ratio
=
0.5
while
gap_size
<
RelativePositioning
::
MIN_GAP
&&
ratio
<
1
gap_size
=
(
ratio
*
RelativePositioning
::
MAX_POSITION
)
/
(
gaps
/
2
)
gap_size
=
[
RelativePositioning
::
IDEAL_DISTANCE
,
(
ratio
*
range
)
/
gaps
].
min
.
floor
ratio
+=
0.1
end
...
...
@@ -37,7 +38,7 @@ class IssueRebalancingService
raise
RelativePositioning
::
NoSpaceLeft
end
start
=
0
-
(
gaps
/
2
)
*
gap_size
start
=
RelativePositioning
::
START_POSITION
-
(
gaps
/
2
)
*
gap_size
Issue
.
transaction
do
indexed
=
base
.
reorder
(
:relative_position
,
:id
).
pluck
(
:id
).
each_with_index
...
...
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