summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/app.cpp')
-rw-r--r--fpdfsdk/javascript/app.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/fpdfsdk/javascript/app.cpp b/fpdfsdk/javascript/app.cpp
index 400340e38d..6d31d7e2e4 100644
--- a/fpdfsdk/javascript/app.cpp
+++ b/fpdfsdk/javascript/app.cpp
@@ -696,19 +696,10 @@ bool app::browseForDoc(CJS_Runtime* pRuntime,
CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath) {
CFX_WideString sRet = L"/";
-
- for (int i = 0, sz = sOldPath.GetLength(); i < sz; i++) {
- wchar_t c = sOldPath.GetAt(i);
- if (c == L':') {
- } else {
- if (c == L'\\') {
- sRet += L"/";
- } else {
- sRet += c;
- }
- }
+ for (const wchar_t& c : sOldPath) {
+ if (c != L':')
+ sRet += (c == L'\\') ? L'/' : c;
}
-
return sRet;
}