Commit cbe7556c by rongjun

bug

parent 72fca0f9
...@@ -18,4 +18,26 @@ function getLocalIpv4s() { ...@@ -18,4 +18,26 @@ function getLocalIpv4s() {
const ips = getLocalIpv4s(); const ips = getLocalIpv4s();
exports.allIps = ips;
\ No newline at end of file function mergeDepth(oldDepth, updateDepth, isAsk) {
var i = []
, r = {
a: 0,
b: 0
};
if (isAsk)
for (; r.a < oldDepth.length || r.b < updateDepth.length;)
void 0 === oldDepth[r.a] ? i.push(updateDepth[r.b++]) : void 0 === updateDepth[r.b] ? i.push(oldDepth[r.a++]) : parseFloat(oldDepth[r.a][0]) > parseFloat(updateDepth[r.b][0]) ? i.push(updateDepth[r.b++]) : oldDepth[r.a][0] == updateDepth[r.b][0] ? (parseFloat(updateDepth[r.b][1]) > 1e-8 ? i.push(updateDepth[r.b++]) : r.b++,
r.a++) : i.push(oldDepth[r.a++]);
else
for (; r.a < oldDepth.length || r.b < updateDepth.length;)
void 0 === oldDepth[r.a] ? i.push(updateDepth[r.b++]) : void 0 === updateDepth[r.b] ? i.push(oldDepth[r.a++]) : parseFloat(oldDepth[r.a][0]) < parseFloat(updateDepth[r.b][0]) ? i.push(updateDepth[r.b++]) : oldDepth[r.a][0] == updateDepth[r.b][0] ? (parseFloat(updateDepth[r.b][1]) > 1e-8 ? i.push(updateDepth[r.b++]) : r.b++,
r.a++) : i.push(oldDepth[r.a++]);
return i
}
module.exports = {
allIps: ips,
mergeDepth: mergeDepth
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment