summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4d9697c)
raw | patch | inline | side by side (parent: 4d9697c)
author | J. Bruce Fields <bfields@citi.umich.edu> | |
Sun, 16 Dec 2007 16:31:38 +0000 (11:31 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 16 Dec 2007 21:07:20 +0000 (13:07 -0800) |
Reorganize to emphasize the most complicated part of the code (the tab
case).
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
case).
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ws.c | patch | blob | history |
index 5ebd1095a2af1dfc75bf79250bb775ac39580a2e..716587498c14843aef1476a9c6b11e403466f992 100644 (file)
--- a/ws.c
+++ b/ws.c
/* Check for space before tab in initial indent. */
for (i = 0; i < len; i++) {
- if (line[i] == '\t') {
- if ((ws_rule & WS_SPACE_BEFORE_TAB) &&
- (leading_space != -1))
- result |= WS_SPACE_BEFORE_TAB;
- break;
- }
- else if (line[i] == ' ')
+ if (line[i] == ' ') {
leading_space = i;
- else
+ continue;
+ }
+ if (line[i] != '\t')
break;
+ if ((ws_rule & WS_SPACE_BEFORE_TAB) && (leading_space != -1))
+ result |= WS_SPACE_BEFORE_TAB;
+ break;
}
/* Check for indent using non-tab. */