]> git.ipfire.org Git - thirdparty/git.git/blobdiff - diffcore-rename.c
path.c: clarify trie_find()'s in-code comment
[thirdparty/git.git] / diffcore-rename.c
index 07bd34b63145e1dc179afebcc7af351c34c2ab07..9624864858dcb4e99d793858c3fe4885d18134e3 100644 (file)
@@ -23,7 +23,7 @@ static int find_rename_dst(struct diff_filespec *two)
        first = 0;
        last = rename_dst_nr;
        while (last > first) {
-               int next = (last + first) >> 1;
+               int next = first + ((last - first) >> 1);
                struct diff_rename_dst *dst = &(rename_dst[next]);
                int cmp = strcmp(two->path, dst->two->path);
                if (!cmp)
@@ -83,7 +83,7 @@ static struct diff_rename_src *register_rename_src(struct diff_filepair *p)
        first = 0;
        last = rename_src_nr;
        while (last > first) {
-               int next = (last + first) >> 1;
+               int next = first + ((last - first) >> 1);
                struct diff_rename_src *src = &(rename_src[next]);
                int cmp = strcmp(one->path, src->p->one->path);
                if (!cmp)
@@ -266,7 +266,7 @@ static unsigned int hash_filespec(struct repository *r,
                hash_object_file(filespec->data, filespec->size, "blob",
                                 &filespec->oid);
        }
-       return sha1hash(filespec->oid.hash);
+       return oidhash(&filespec->oid);
 }
 
 static int find_identical_files(struct hashmap *srcs,