rhg: small refactor: stop using a magical constant "+ 1"
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Thu, 16 Feb 2023 19:14:51 +0000
changeset 50165 4180c988d1d5
parent 50164 8e50aa0db347
child 50166 6ea3b1acb5de
rhg: small refactor: stop using a magical constant "+ 1" Instead, directly do what the "+ 1" was supposed to achive: call hash_encode.
rust/hg-core/src/revlog/path_encode.rs
--- a/rust/hg-core/src/revlog/path_encode.rs	Thu Feb 16 19:03:17 2023 +0000
+++ b/rust/hg-core/src/revlog/path_encode.rs	Thu Feb 16 19:14:51 2023 +0000
@@ -600,7 +600,7 @@
         basic_encode(&mut measure, path);
         measure.len
     } else {
-        MAXSTOREPATHLEN + 1
+        return hash_encode(path);
     };
     if newlen <= MAXSTOREPATHLEN {
         if newlen == path.len() {