Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
94d6049f
Commit
94d6049f
authored
Aug 08, 2017
by
yann300
Committed by
GitHub
Aug 08, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #536 from ethereum/fixSteppingBack
fix findClosestIndex
parents
842cc983
67c67958
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
util.js
src/helpers/util.js
+2
-2
No files found.
src/helpers/util.js
View file @
94d6049f
...
@@ -99,9 +99,9 @@ module.exports = {
...
@@ -99,9 +99,9 @@ module.exports = {
}
}
var
index
=
this
.
findLowerBound
(
target
,
array
)
var
index
=
this
.
findLowerBound
(
target
,
array
)
if
(
index
<
0
)
{
if
(
index
<
0
)
{
return
array
[
0
]
return
0
}
else
if
(
index
>=
array
.
length
-
1
)
{
}
else
if
(
index
>=
array
.
length
-
1
)
{
return
array
[
array
.
length
-
1
]
return
array
.
length
-
1
}
else
{
}
else
{
var
middle
=
(
array
[
index
]
+
array
[
index
+
1
])
/
2
var
middle
=
(
array
[
index
]
+
array
[
index
+
1
])
/
2
return
target
<=
middle
?
index
:
index
+
1
return
target
<=
middle
?
index
:
index
+
1
...
...
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