summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp5
-rw-r--r--fpdfsdk/src/javascript/util.cpp12
2 files changed, 7 insertions, 10 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index eaf2dda36c..a20ca8f44d 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -26,6 +26,7 @@
#include "global.h"
#include "report.h"
#include "util.h"
+#include "third_party/base/stl_util.h"
#ifdef PDF_ENABLE_XFA
#include "../../../xfa/src/fxjse/src/value.h"
@@ -326,11 +327,11 @@ FX_BOOL CJS_Runtime::SetHValueByName(const CFX_ByteStringC& utf8Name,
#endif
void CJS_Runtime::AddObserver(Observer* observer) {
- ASSERT(m_observers.find(observer) == m_observers.end());
+ ASSERT(!pdfium::ContainsKey(m_observers, observer));
m_observers.insert(observer);
}
void CJS_Runtime::RemoveObserver(Observer* observer) {
- ASSERT(m_observers.find(observer) != m_observers.end());
+ ASSERT(pdfium::ContainsKey(m_observers, observer));
m_observers.erase(observer);
}
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index cb9c9b2231..a14e81c203 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -468,17 +468,13 @@ void util::printx(const std::string& cFormat,
case '\\':
break;
case '>': {
- for (std::string::iterator it = cSource.begin(); it != cSource.end();
- it++) {
- *it = toupper(*it);
- }
+ for (char& c : cSource)
+ c = toupper(c);
break;
}
case '<': {
- for (std::string::iterator it = cSource.begin(); it != cSource.end();
- it++) {
- *it = tolower(*it);
- }
+ for (char& c : cSource)
+ c = tolower(c);
break;
}
case '=':