[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04-ifs-to-switch
From: |
Dave |
Subject: |
04-ifs-to-switch |
Date: |
Sat, 16 Mar 2002 16:08:22 +0100 |
ChangeLog:
2002-03-16 David Sterba <address@hidden>
* m4/output.c (mkstemp): Use switch instead of ifs.
Patch:
--- m4.dev/m4/output.c 2001/10/13 06:28:10
+++ m4/m4/output.c 2001/10/15 13:16:19
@@ -178,15 +178,13 @@
}
/* this will ensure we cover a-zA-Z0-9 before giving up */
- if (uniq == 'z') {
- uniq = 'A';
- } else if (uniq == 'Z') {
- uniq = '0';
- } else if (uniq == '9') {
+ switch (uniq) {
+ case 'z': uniq = 'A';break;
+ case 'Z': uniq = '0';break;
+ case '9':
errno = EEXIST; /* couldn't find one */
return -1;
- } else {
- uniq++;
+ default: uniq++;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 04-ifs-to-switch,
Dave <=