D909: cext: put case statements on separate line
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Mon Oct 2 18:31:45 UTC 2017
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This seems to be the prevailing style, even though it is a bit more
verbose for very simple switch statements.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D909
AFFECTED FILES
mercurial/cext/charencode.c
CHANGE DETAILS
diff --git a/mercurial/cext/charencode.c b/mercurial/cext/charencode.c
--- a/mercurial/cext/charencode.c
+++ b/mercurial/cext/charencode.c
@@ -319,13 +319,20 @@
static char jsonescapechar2(char c)
{
switch (c) {
- case '\b': return 'b';
- case '\t': return 't';
- case '\n': return 'n';
- case '\f': return 'f';
- case '\r': return 'r';
- case '"': return '"';
- case '\\': return '\\';
+ case '\b':
+ return 'b';
+ case '\t':
+ return 't';
+ case '\n':
+ return 'n';
+ case '\f':
+ return 'f';
+ case '\r':
+ return 'r';
+ case '"':
+ return '"';
+ case '\\':
+ return '\\';
}
return '\0'; /* should not happen */
}
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list