summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 00:03:18 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 00:03:18 +0000
commitf6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3 (patch)
tree840cfc698d0c1287ef8802ca9a564ae7abdd0f13 /o3d
parent9ad77099038a76c96f6c4d162fb0706426215a5f (diff)
downloadchromium_src-f6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3.zip
chromium_src-f6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3.tar.gz
chromium_src-f6b8ce31c12a8fd5c969608bfdec0e2e8f1e99c3.tar.bz2
Pure pedantry: Replace all ".size() == 0" with ".empty()".
BUG=carnitas TEST=compiles; existing unit tests. Review URL: http://codereview.chromium.org/6602049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76467 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/core/cross/gl/effect_gl.cc2
-rw-r--r--o3d/core/cross/gpu2d/interval_tree_test.cc4
-rw-r--r--o3d/core/cross/gpu2d/path_processor.cc4
-rw-r--r--o3d/plugin/cross/stream_manager.cc2
-rw-r--r--o3d/plugin/idl/bounding_box.idl2
-rw-r--r--o3d/utils/cross/text_reader.cc2
6 files changed, 8 insertions, 8 deletions
diff --git a/o3d/core/cross/gl/effect_gl.cc b/o3d/core/cross/gl/effect_gl.cc
index 71ce602..755d80a 100644
--- a/o3d/core/cross/gl/effect_gl.cc
+++ b/o3d/core/cross/gl/effect_gl.cc
@@ -378,7 +378,7 @@ ParamTexture* EffectGL::GetTextureParamFromCgSampler(
DLOG_ASSERT(cgGetParameterType(cg_sampler) != CG_SAMPLER);
String sampler_name = cgGetParameterName(cg_sampler);
String param_name = GetTextureNameFromSamplerParamName(sampler_name);
- if (param_name.size() == 0) {
+ if (param_name.empty()) {
// Sampler has no texture associated with it.
return NULL;
}
diff --git a/o3d/core/cross/gpu2d/interval_tree_test.cc b/o3d/core/cross/gpu2d/interval_tree_test.cc
index 29118b2..95b48d0 100644
--- a/o3d/core/cross/gpu2d/interval_tree_test.cc
+++ b/o3d/core/cross/gpu2d/interval_tree_test.cc
@@ -177,9 +177,9 @@ InsertionAndDeletionTest(unsigned seed, int tree_size) {
// Now randomly add or remove elements.
for (int i = 0; i < 2 * tree_size; i++) {
bool add = false;
- if (added_elements.size() == 0) {
+ if (added_elements.empty()) {
add = true;
- } else if (removed_elements.size() == 0) {
+ } else if (removed_elements.empty()) {
add = false;
} else {
add = (NextRandom(2) == 1);
diff --git a/o3d/core/cross/gpu2d/path_processor.cc b/o3d/core/cross/gpu2d/path_processor.cc
index 756ae48..6e50e9e 100644
--- a/o3d/core/cross/gpu2d/path_processor.cc
+++ b/o3d/core/cross/gpu2d/path_processor.cc
@@ -1105,7 +1105,7 @@ void PathProcessor::SubdivideCurves() {
std::vector<SweepInterval> overlaps;
for (int cur_iter = 0; cur_iter < kMaxIter; ++cur_iter) {
- if (cur_segments.size() == 0) {
+ if (cur_segments.empty()) {
// Done
break;
}
@@ -1224,7 +1224,7 @@ void PathProcessor::SubdivideCurvesSlow() {
const int kMaxIter = 5;
for (int cur_iter = 0; cur_iter < kMaxIter; ++cur_iter) {
- if (cur_segments.size() == 0) {
+ if (cur_segments.empty()) {
// Done
break;
}
diff --git a/o3d/plugin/cross/stream_manager.cc b/o3d/plugin/cross/stream_manager.cc
index 48da1c1..783b114 100644
--- a/o3d/plugin/cross/stream_manager.cc
+++ b/o3d/plugin/cross/stream_manager.cc
@@ -310,7 +310,7 @@ bool StreamManager::NPDownloadStream::URLNotify(NPReason reason) {
// Note that the streaming case (NP_NORMAL) does not get a file
// so we can't check its size
if ((reason != NPRES_DONE) ||
- (stream_type_ != NP_NORMAL && file_.size() == 0)) {
+ (stream_type_ != NP_NORMAL && file_.empty())) {
// finished_callback should only be called once.
finished_callback_->Run(this, false, "", "");
finished_callback_.reset(NULL);
diff --git a/o3d/plugin/idl/bounding_box.idl b/o3d/plugin/idl/bounding_box.idl
index 9a5cc82..23e5d88 100644
--- a/o3d/plugin/idl/bounding_box.idl
+++ b/o3d/plugin/idl/bounding_box.idl
@@ -135,7 +135,7 @@ class BoundingBox {
void* plugin_data,
o3d::BoundingBox* _this,
const std::vector<std::vector<float> >& values) {
- if (values.size() == 0) {
+ if (values.empty()) {
*_this = o3d::BoundingBox();
} else if (values.size() != 2) {
o3d::ServiceLocator* service_locator =
diff --git a/o3d/utils/cross/text_reader.cc b/o3d/utils/cross/text_reader.cc
index dccbffa..c6f1e56 100644
--- a/o3d/utils/cross/text_reader.cc
+++ b/o3d/utils/cross/text_reader.cc
@@ -48,7 +48,7 @@ TextReader::~TextReader() {
}
int TextReader::TestForEndOfLine(const std::string& eol) {
- if (eol.size() == 0) {
+ if (eol.empty()) {
return 0;
}
if (eol[0] == kLinefeed) {