diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-09-26 21:01:36 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-09-26 21:01:36 +0000 |
| commit | e6402fab7e8e858314ea0ea3b5c496c17a2c272b (patch) | |
| tree | a3bb7920ffbf0c9d9500b2731c02d4be393922ce /src | |
| parent | cppcheck (diff) | |
| download | inkscape-e6402fab7e8e858314ea0ea3b5c496c17a2c272b.tar.gz inkscape-e6402fab7e8e858314ea0ea3b5c496c17a2c272b.zip | |
cppcheck: performance
(bzr r12598)
Diffstat (limited to 'src')
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 8 | ||||
| -rw-r--r-- | src/libnrtype/Layout-TNG-Input.cpp | 4 | ||||
| -rw-r--r-- | src/libnrtype/Layout-TNG-Output.cpp | 14 | ||||
| -rw-r--r-- | src/libnrtype/font-lister.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/template-widget.cpp | 2 | ||||
| -rw-r--r-- | src/ui/widget/unit-tracker.cpp | 2 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index c91e57065..c896cc470 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -348,7 +348,7 @@ font_factory::~font_factory(void) PangoStringToDescrMap::iterator it = fontInstanceMap.begin(); while (it != fontInstanceMap.end()) { pango_font_description_free((*it).second); - it++; + ++it; } } @@ -662,7 +662,7 @@ Glib::ustring font_factory::FontSpecificationBestMatch(const Glib::ustring & fon Glib::ustring bestMatchDescription; bool setFirstFamilyMatch = false; - for (it = fontInstanceMap.begin(); it != fontInstanceMap.end(); it++) { + for (it = fontInstanceMap.begin(); it != fontInstanceMap.end(); ++it) { Glib::ustring currentFontSpec = (*it).first; Glib::ustring currentFamily = GetUIFamilyString((*it).second); @@ -776,7 +776,7 @@ void font_factory::GetUIFamiliesAndStyles(FamilyToStylesMap *map) for (std::list<Glib::ustring>::iterator it=styleList.begin(); it != styleList.end(); - it++) { + ++it) { if (*it == styleUIName) { exists = true; break; @@ -809,7 +809,7 @@ void font_factory::GetUIFamiliesAndStyles(FamilyToStylesMap *map) families = 0; // Sort the style lists - for (FamilyToStylesMap::iterator iter = map->begin() ; iter != map->end(); iter++) { + for (FamilyToStylesMap::iterator iter = map->begin() ; iter != map->end(); ++iter) { (*iter).second.sort(StyleNameCompareInternal); } } diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp index 10310b4aa..c7b0948e8 100644 --- a/src/libnrtype/Layout-TNG-Input.cpp +++ b/src/libnrtype/Layout-TNG-Input.cpp @@ -25,7 +25,7 @@ namespace Text { void Layout::_clearInputObjects() { - for(std::vector<InputStreamItem*>::iterator it = _input_stream.begin() ; it != _input_stream.end() ; it++) + for(std::vector<InputStreamItem*>::iterator it = _input_stream.begin() ; it != _input_stream.end() ; ++it) delete *it; _input_stream.clear(); _input_wrap_shapes.clear(); @@ -46,7 +46,7 @@ void Layout::appendText(Glib::ustring const &text, SPStyle *style, void *source_ sp_style_ref(style); new_source->text_length = 0; - for ( ; text_begin != text_end && text_begin != text.end() ; text_begin++) + for ( ; text_begin != text_end && text_begin != text.end() ; ++text_begin) new_source->text_length++; // save this because calculating the length of a UTF-8 string is expensive if (optional_attributes) { diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp index 060cecebf..1989c495a 100644 --- a/src/libnrtype/Layout-TNG-Output.cpp +++ b/src/libnrtype/Layout-TNG-Output.cpp @@ -85,7 +85,7 @@ void Layout::_clearOutputObjects() _paragraphs.clear(); _lines.clear(); _chunks.clear(); - for (std::vector<Span>::iterator it_span = _spans.begin() ; it_span != _spans.end() ; it_span++) + for (std::vector<Span>::iterator it_span = _spans.begin() ; it_span != _spans.end() ; ++it_span) if (it_span->font) it_span->font->Unref(); _spans.clear(); _characters.clear(); @@ -330,7 +330,7 @@ std:: cout << "DEBUG Layout::print in while " // conditions that prevent this character from joining the record lc_index++; if(lc_index >= _characters.size()) break; // nothing more to process, so it must be the end of the record - text_iter++; + ++text_iter; if(doUTN)newtarget=SingleUnicodeToNon(*text_iter); // this should only ever be with a 1:1 glyph:character situation if(newtarget != oldtarget)break; // change in unicode to nonunicode translation status // MUST exit on any major span change, but not on some little events, like a font substitution event irrelvant for the file save @@ -424,7 +424,7 @@ void Layout::showGlyphs(CairoRenderContext *ctx) const unsigned original_span = _characters[char_index].in_span; while (char_index && _characters[char_index - 1].in_span == original_span) { char_index--; - span_iter++; + ++span_iter; } // try to output as many characters as possible in one go @@ -434,7 +434,7 @@ void Layout::showGlyphs(CairoRenderContext *ctx) const glyphtext.clear(); do { span_string += *span_iter; - span_iter++; + ++span_iter; unsigned same_character = _glyphs[glyph_index].in_character; while (glyph_index < _glyphs.size() && _glyphs[glyph_index].in_character == same_character) { @@ -550,11 +550,11 @@ Glib::ustring Layout::dumpAsText() const for(unsigned j = 0; j < _characters.size() ; j++){ if(lastspan != _characters[j].in_span){ lastspan = _characters[j].in_span; - icc = _spans[lastspan].input_stream_first_character; + icc = _spans[lastspan].input_stream_first_character; } snprintf(line, sizeof(line), "char %4d: '%c' 0x%4.4x x=%8.4f glyph=%3d span=%3d\n", j, *icc, *icc, _characters[j].x, _characters[j].in_glyph, _characters[j].in_span); result += line; - icc++; + ++icc; } } if(_glyphs.size()){ @@ -602,7 +602,7 @@ Glib::ustring Layout::dumpAsText() const snprintf(line, sizeof(line), " %d: control x=%f flags=%03x glyph=%d\n", char_index, _characters[char_index].x, *u.uattr, _characters[char_index].in_glyph); } else { // some text has empty tspans, iter_char cannot be dereferenced snprintf(line, sizeof(line), " %d: '%c' 0x%4.4x x=%f flags=%03x glyph=%d\n", char_index, *iter_char, *iter_char, _characters[char_index].x, *u.uattr, _characters[char_index].in_glyph); - iter_char++; + ++iter_char; } result += line; } diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index 39a04914b..0a83f55e9 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -39,7 +39,7 @@ namespace Inkscape std::list<Glib::ustring> familyList; for (FamilyToStylesMap::iterator iter = familyStyleMap.begin(); iter != familyStyleMap.end(); - iter++) { + ++iter) { familyList.push_back((*iter).first); } familyList.sort(); @@ -60,7 +60,7 @@ namespace Inkscape std::list<Glib::ustring> &styleStrings = familyStyleMap[familyName]; for (std::list<Glib::ustring>::iterator it=styleStrings.begin(); it != styleStrings.end(); - it++) { + ++it) { styles = g_list_append(styles, g_strdup((*it).c_str())); } diff --git a/src/ui/dialog/template-widget.cpp b/src/ui/dialog/template-widget.cpp index 7e34e5a58..898903f2b 100644 --- a/src/ui/dialog/template-widget.cpp +++ b/src/ui/dialog/template-widget.cpp @@ -120,7 +120,7 @@ void TemplateWidget::_displayTemplateDetails() if (_current_template.long_description != "") message += _("Description: ") + _current_template.long_description + "\n\n"; - if (_current_template.keywords.size() > 0){ + if (~_current_template.keywords.empty()){ message += _("Keywords: "); for (std::set<Glib::ustring>::iterator it = _current_template.keywords.begin(); it != _current_template.keywords.end(); ++it) message += *it + " "; diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp index 5b2dc031b..f9b0c3a44 100644 --- a/src/ui/widget/unit-tracker.cpp +++ b/src/ui/widget/unit-tracker.cpp @@ -41,7 +41,7 @@ UnitTracker::UnitTracker(UnitType unit_type) : UnitTable::UnitMap::iterator m_iter = m.begin(); while(m_iter != m.end()) { Glib::ustring text = (*m_iter).first; - m_iter++; + ++m_iter; gtk_list_store_append(_store, &iter); gtk_list_store_set(_store, &iter, COLUMN_STRING, text.c_str(), -1); } |
