some slight cleanup
This commit is contained in:
		@@ -102,6 +102,7 @@ while (rightCursor > 0) {
 | 
				
			|||||||
  );
 | 
					  );
 | 
				
			||||||
  if (target.index < Infinity && target.index < rightCursor) {
 | 
					  if (target.index < Infinity && target.index < rightCursor) {
 | 
				
			||||||
    // slot exists; move the file, update the array, and update the space lists
 | 
					    // slot exists; move the file, update the array, and update the space lists
 | 
				
			||||||
 | 
					    // but only if the new location is actually to the right of our cursor
 | 
				
			||||||
    sparceArray.splice(
 | 
					    sparceArray.splice(
 | 
				
			||||||
      target.index,
 | 
					      target.index,
 | 
				
			||||||
      fileSize,
 | 
					      fileSize,
 | 
				
			||||||
@@ -114,11 +115,9 @@ while (rightCursor > 0) {
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
    spaces[target.size].shift();
 | 
					    spaces[target.size].shift();
 | 
				
			||||||
    if (toNum(target.size) - fileSize > 0) {
 | 
					    if (toNum(target.size) - fileSize > 0) {
 | 
				
			||||||
      spaces[(toNum(target.size) - fileSize).toString()].unshift(
 | 
					      let newGap = (toNum(target.size) - fileSize).toString();
 | 
				
			||||||
        target.index + fileSize
 | 
					      spaces[newGap] = [...spaces[newGap], target.index + fileSize].sort(
 | 
				
			||||||
      );
 | 
					        (a, b) => (a > b ? 1 : -1)
 | 
				
			||||||
      spaces[(toNum(target.size) - fileSize).toString()].sort((a, b) =>
 | 
					 | 
				
			||||||
        a > b ? 1 : -1
 | 
					 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user