MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / mergeLow

Function mergeLow

libs/echarts/echarts.simple.js:6112–6256  ·  view source on GitHub ↗
(start1, length1, start2, length2)

Source from the content-addressed store, hash-verified

6110 }
6111
6112 function mergeLow(start1, length1, start2, length2) {
6113 var i = 0;
6114
6115 for (i = 0; i < length1; i++) {
6116 tmp[i] = array[start1 + i];
6117 }
6118
6119 var cursor1 = 0;
6120 var cursor2 = start2;
6121 var dest = start1;
6122
6123 array[dest++] = array[cursor2++];
6124
6125 if (--length2 === 0) {
6126 for (i = 0; i < length1; i++) {
6127 array[dest + i] = tmp[cursor1 + i];
6128 }
6129 return;
6130 }
6131
6132 if (length1 === 1) {
6133 for (i = 0; i < length2; i++) {
6134 array[dest + i] = array[cursor2 + i];
6135 }
6136 array[dest + length2] = tmp[cursor1];
6137 return;
6138 }
6139
6140 var _minGallop = minGallop;
6141 var count1;
6142 var count2;
6143 var exit;
6144
6145 while (1) {
6146 count1 = 0;
6147 count2 = 0;
6148 exit = false;
6149
6150 do {
6151 if (compare(array[cursor2], tmp[cursor1]) < 0) {
6152 array[dest++] = array[cursor2++];
6153 count2++;
6154 count1 = 0;
6155
6156 if (--length2 === 0) {
6157 exit = true;
6158 break;
6159 }
6160 }
6161 else {
6162 array[dest++] = tmp[cursor1++];
6163 count1++;
6164 count2 = 0;
6165 if (--length1 === 1) {
6166 exit = true;
6167 break;
6168 }
6169 }

Callers 1

mergeAtFunction · 0.70

Calls 3

compareFunction · 0.70
gallopRightFunction · 0.70
gallopLeftFunction · 0.70

Tested by

no test coverage detected