Patchwork [1,of,4] parsers: drop Python 2.4 compat in make_file_foldmap

login
register
mail settings
Submitter Siddharth Agarwal
Date June 16, 2015, 7:55 a.m.
Message ID <1507377b3cf3cdd7c232.1434441354@devbig136.prn2.facebook.com>
Download mbox | patch
Permalink /patch/9659/
State Accepted
Headers show

Comments

Siddharth Agarwal - June 16, 2015, 7:55 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1434432569 25200
#      Mon Jun 15 22:29:29 2015 -0700
# Node ID 1507377b3cf3cdd7c232167c13570c121c23ea63
# Parent  a69983942fb4dbfdf5ca8c7a123120ed09ead5db
parsers: drop Python 2.4 compat in make_file_foldmap

Patch

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -205,7 +205,6 @@  static PyObject *make_file_foldmap(PyObj
 		goto quit;
 	}
 
-#if PY_VERSION_HEX >= 0x02060000
 	/* _PyDict_NewPresized expects a minused parameter, but it actually
 	   creates a dictionary that's the nearest power of two bigger than the
 	   parameter. For example, with the initial minused = 1000, the
@@ -215,10 +214,6 @@  static PyObject *make_file_foldmap(PyObj
 	   anyway. So create a dictionary that's 3/2 the size. Also add some
 	   more to deal with additions outside this function. */
 	file_foldmap = _PyDict_NewPresized((PyDict_Size(dmap) / 5) * 8);
-#else
-	file_foldmap = PyDict_New();
-#endif
-
 	if (file_foldmap == NULL)
 		goto quit;