1// Copyright (c) Facebook, Inc. and its affiliates
2// SPDX-License-Identifier: MIT OR Apache-2.0
6public final class Slice {
7 public final int start;
10 public Slice(int start, int end) {
15 // Lexicographic comparison between the (unsigned!) bytes referenced by `slice1` and `slice2`
17 public static int compare_bytes(byte[] content, Slice slice1, Slice slice2) {
18 int start1 = slice1.start;
19 int end1 = slice1.end;
20 int start2 = slice2.start;
21 int end2 = slice2.end;
22 for (int i = 0; i < end1 - start1; i++) {
23 int byte1 = content[start1 + i] & 0xFF;
24 if (start2 + i >= end2) {
27 int byte2 = content[start2 + i] & 0xFF;
35 if (end2 - start2 > end1 - start1) {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list