Patchwork D6651: rust-utils: remove buggy assertion

login
register
mail settings
Submitter phabricator
Date July 17, 2019, 11:04 p.m.
Message ID <0e88ab201002bc7520a39520f0bcba08@localhost.localdomain>
Download mbox | patch
Permalink /patch/40956/
State Not Applicable
Headers show

Comments

phabricator - July 17, 2019, 11:04 p.m.
Closed by commit rHGa6a272c4ebf9: rust-utils: remove buggy assertion (authored by Alphare).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6651?vs=15930&id=15940

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6651/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6651

AFFECTED FILES
  rust/hg-core/src/utils.rs

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel

Patch

diff --git a/rust/hg-core/src/utils.rs b/rust/hg-core/src/utils.rs
--- a/rust/hg-core/src/utils.rs
+++ b/rust/hg-core/src/utils.rs
@@ -18,8 +18,7 @@ 
 where
     T: Clone + PartialEq,
 {
-    assert_eq!(from.len(), to.len());
-    if buf.len() < from.len() {
+    if buf.len() < from.len() || from.len() != to.len() {
         return;
     }
     for i in 0..=buf.len() - from.len() {