D907: cext: move braces for control statements to same line

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Tue Oct 3 17:05:02 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGce26a13869fb: cext: move braces for control statements to same line (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D907?vs=2346&id=2387

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

AFFECTED FILES
  mercurial/cext/base85.c
  mercurial/cext/revlog.c

CHANGE DETAILS

diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c
--- a/mercurial/cext/revlog.c
+++ b/mercurial/cext/revlog.c
@@ -445,8 +445,7 @@
 		iter = PyObject_GetIter(list);
 		if (iter == NULL)
 			return -2;
-		while ((iter_item = PyIter_Next(iter)))
-		{
+		while ((iter_item = PyIter_Next(iter))) {
 			iter_item_long = PyInt_AS_LONG(iter_item);
 			Py_DECREF(iter_item);
 			if (iter_item_long < min_idx)
diff --git a/mercurial/cext/base85.c b/mercurial/cext/base85.c
--- a/mercurial/cext/base85.c
+++ b/mercurial/cext/base85.c
@@ -96,24 +96,21 @@
 	dst = PyBytes_AsString(out);
 
 	i = 0;
-	while (i < len)
-	{
+	while (i < len) {
 		acc = 0;
 		cap = len - i - 1;
 		if (cap > 4)
 			cap = 4;
-		for (j = 0; j < cap; i++, j++)
-		{
+		for (j = 0; j < cap; i++, j++) {
 			c = b85dec[(int)*text++] - 1;
 			if (c < 0)
 				return PyErr_Format(
 					PyExc_ValueError,
 					"bad base85 character at position %d",
 					(int)i);
 			acc = acc * 85 + c;
 		}
-		if (i++ < len)
-		{
+		if (i++ < len) {
 			c = b85dec[(int)*text++] - 1;
 			if (c < 0)
 				return PyErr_Format(
@@ -136,8 +133,7 @@
 			acc *= 85;
 		if (cap && cap < 4)
 			acc += 0xffffff >> (cap - 1) * 8;
-		for (j = 0; j < cap; j++)
-		{
+		for (j = 0; j < cap; j++) {
 			acc = (acc << 8) | (acc >> 24);
 			*dst++ = acc;
 		}



To: indygreg, #hg-reviewers, quark
Cc: mercurial-devel


More information about the Mercurial-devel mailing list