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
3bad42ce
Commit
3bad42ce
authored
Feb 13, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
round instead of floor
parent
d0f0bd05
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
util.js
src/helpers/util.js
+14
-0
StepManager.js
src/ui/StepManager.js
+1
-1
No files found.
src/helpers/util.js
View file @
3bad42ce
...
@@ -85,6 +85,20 @@ module.exports = {
...
@@ -85,6 +85,20 @@ module.exports = {
return
index
>=
0
?
array
[
index
]
:
null
return
index
>=
0
?
array
[
index
]
:
null
},
},
/*
Binary Search:
Assumes that @arg array is sorted increasingly
return (saying middle=(array[i] + array[i + 1]) / 2 <= target) return i if target < middle; return i + 1 if target >= middle; return array.length - 1 if index > array.length; return null if array[0] > target || array is empty
*/
findLowerClosestBound
:
function
(
target
,
array
)
{
var
index
=
this
.
findLowerBound
(
target
,
array
)
if
(
index
>
array
.
length
)
{
return
index
}
var
middle
=
(
array
[
index
]
+
array
[
index
+
1
])
/
2
return
target
>=
middle
?
index
+
1
:
index
},
/**
/**
* Find the call from @args rootCall which contains @args index (recursive)
* Find the call from @args rootCall which contains @args index (recursive)
*
*
...
...
src/ui/StepManager.js
View file @
3bad42ce
...
@@ -64,7 +64,7 @@ function StepManager (_parent, _traceManager) {
...
@@ -64,7 +64,7 @@ function StepManager (_parent, _traceManager) {
StepManager
.
prototype
.
resolveToReducedTrace
=
function
(
value
,
incr
)
{
StepManager
.
prototype
.
resolveToReducedTrace
=
function
(
value
,
incr
)
{
if
(
this
.
parent
.
callTree
.
reducedTrace
.
length
)
{
if
(
this
.
parent
.
callTree
.
reducedTrace
.
length
)
{
var
nextSource
=
utils
.
findLowerBound
(
value
,
this
.
parent
.
callTree
.
reducedTrace
)
var
nextSource
=
utils
.
findLower
Closest
Bound
(
value
,
this
.
parent
.
callTree
.
reducedTrace
)
nextSource
=
nextSource
<
this
.
parent
.
callTree
.
reducedTrace
.
length
-
1
?
nextSource
+
incr
:
nextSource
nextSource
=
nextSource
<
this
.
parent
.
callTree
.
reducedTrace
.
length
-
1
?
nextSource
+
incr
:
nextSource
return
this
.
parent
.
callTree
.
reducedTrace
[
nextSource
]
return
this
.
parent
.
callTree
.
reducedTrace
[
nextSource
]
}
}
...
...
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