From: Enrico Forestieri Date: Sat, 23 May 2009 13:16:13 +0000 (+0000) Subject: Avoid calling prefixIs() if not needed. X-Git-Tag: 2.0.0~6462 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7ae4f6ac6feca523256d731c2455ab22086aad7f;p=features.git Avoid calling prefixIs() if not needed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29824 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/support/os_cygwin.cpp b/src/support/os_cygwin.cpp index 3ab910fedd..1bfffdc828 100644 --- a/src/support/os_cygwin.cpp +++ b/src/support/os_cygwin.cpp @@ -185,7 +185,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how) if (i + 1 != p2.length()) return false; - if (!prefixIs(path, pre) && how == CASE_ADJUSTED) + if (how == CASE_ADJUSTED && !prefixIs(path, pre)) path = to_utf8(p2 + p1.substr(i + 1, p1.length() - i + 1)); return true; diff --git a/src/support/os_unix.cpp b/src/support/os_unix.cpp index 976fcf75e8..15c5e63369 100644 --- a/src/support/os_unix.cpp +++ b/src/support/os_unix.cpp @@ -98,7 +98,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how) if (i + 1 != p2.length()) return false; - if (!prefixIs(path, pre) && how == CASE_ADJUSTED) + if (how == CASE_ADJUSTED && !prefixIs(path, pre)) path = to_utf8(p2 + p1.substr(i + 1, p1.length() - i + 1)); return true; diff --git a/src/support/os_win32.cpp b/src/support/os_win32.cpp index 732cdc55ab..722895b1cf 100644 --- a/src/support/os_win32.cpp +++ b/src/support/os_win32.cpp @@ -216,7 +216,7 @@ bool path_prefix_is(string & path, string const & pre, path_case how) if (i + 1 != p2.length()) return false; - if (!prefixIs(path, pre) && how == CASE_ADJUSTED) + if (how == CASE_ADJUSTED && !prefixIs(path, pre)) path = to_utf8(p2 + p1.substr(i + 1, p1.length() - i + 1)); return true;