Patchwork D6592: rust-minor-fixes: simplify overly complicated expression

login
register
mail settings
Submitter phabricator
Date July 5, 2019, 12:52 p.m.
Message ID <5300fdabd046661efde1be8aa82bc5e1@localhost.localdomain>
Download mbox | patch
Permalink /patch/40789/
State Not Applicable
Headers show

Comments

phabricator - July 5, 2019, 12:52 p.m.
Closed by commit rHG11c025c83393: rust: simplify overly complicated expression (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/D6592?vs=15728&id=15773

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

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

AFFECTED FILES
  rust/hg-cpython/src/dirstate.rs

CHANGE DETAILS




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

Patch

diff --git a/rust/hg-cpython/src/dirstate.rs b/rust/hg-cpython/src/dirstate.rs
--- a/rust/hg-cpython/src/dirstate.rs
+++ b/rust/hg-cpython/src/dirstate.rs
@@ -291,8 +291,7 @@ 
         Ok(self
             .dirs_map(py)
             .borrow()
-            .get(&item.extract::<PyBytes>(py)?.data(py).to_owned())
-            .is_some())
+            .contains_key(item.extract::<PyBytes>(py)?.data(py).as_ref()))
     }
 });