introduce LONE_CHAR (optimized strcmp with one-char string)

This commit is contained in:
Denis Vlasenko
2006-12-21 13:23:14 +00:00
parent 6910741067
commit bf66fbc8e2
17 changed files with 49 additions and 35 deletions

View File

@@ -144,7 +144,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file,
* read/write, since if the root is mounted read/only, the
* contents of /etc/mtab may not be accurate.
*/
if (!strcmp(mnt->mnt_dir, "/")) {
if (LONE_CHAR(mnt->mnt_dir, '/')) {
is_root:
#define TEST_FILE "/.ismount-test-file"
*mount_flags |= EXT2_MF_ISROOT;