Patchwork [06,of,11] py3: do not pass a float to dict_new_presized()

login
register
mail settings
Submitter Yuya Nishihara
Date March 3, 2018, 1:27 p.m.
Message ID <87b0df6c39fff3ac758a.1520083659@mimosa>
Download mbox | patch
Permalink /patch/28771/
State Accepted
Headers show

Comments

Yuya Nishihara - March 3, 2018, 1:27 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1520077487 18000
#      Sat Mar 03 06:44:47 2018 -0500
# Node ID 87b0df6c39fff3ac758a52a9b0b95bca1f61187c
# Parent  a04953df1a93b64c199ce7be8f2237c225b49de3
py3: do not pass a float to dict_new_presized()

I really don't like the division operator of Python 3 since I'm not doing
a math.

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1431,7 +1431,7 @@  class dirstatemap(object):
             # This heuristic is imperfect in many ways, so in a future dirstate
             # format update it makes sense to just record the number of entries
             # on write.
-            self._map = parsers.dict_new_presized(len(st) / 71)
+            self._map = parsers.dict_new_presized(len(st) // 71)
 
         # Python's garbage collector triggers a GC each time a certain number
         # of container objects (the number being defined by