Patchwork [06,of,11] rust-dirstate: use PARENT_SIZE constant where appropriate

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 17, 2019, 12:12 p.m.
Message ID <a57c56ff9cec59f12780.1566043927@mimosa>
Download mbox | patch
Permalink /patch/41328/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 17, 2019, 12:12 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1566017705 -32400
#      Sat Aug 17 13:55:05 2019 +0900
# Node ID a57c56ff9cec59f12780c83f5dc2ab679d2523e6
# Parent  f61ecf74968aae152d1cdbe946d3f418b0fa1381
rust-dirstate: use PARENT_SIZE constant where appropriate

Patch

diff --git a/rust/hg-core/src/dirstate/dirstate_map.rs b/rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs
@@ -258,7 +258,7 @@  impl DirstateMap {
             return Ok(parents.clone());
         }
         let parents;
-        if file_contents.len() == 40 {
+        if file_contents.len() == PARENT_SIZE * 2 {
             parents = DirstateParents {
                 p1: copy_into_array(&file_contents[..PARENT_SIZE]),
                 p2: copy_into_array(