diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 20:31:49 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2019-09-12 04:13:03 +0300 |
commit | daa295fc5fba56b98970a075f4b8c5d8d93e6916 (patch) | |
tree | 96d593dc51fc67f89223cb56948db4d6be01b2c5 /source/blender/imbuf | |
parent | eeb91051f6cac1107a55bd06e4a2d92e4aeea4dc (diff) |
Partially revert "Cleanup: use post increment/decrement"
This partially reverts commit 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0
Post increment can deep-copy for C++ iterators, while in my own checks
GCC was able to optimize this to get the same output,
better follow C++ best practice and use pre-increment for iterators.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/openexr/openexr_api.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 41db874c2b2..88dfa42a416 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -718,7 +718,7 @@ void IMB_exr_add_view(void *handle, const char *name) static int imb_exr_get_multiView_id(StringVector &views, const std::string &name) { int count = 0; - for (StringVector::const_iterator i = views.begin(); count < views.size(); i++) { + for (StringVector::const_iterator i = views.begin(); count < views.size(); ++i) { if (name == *i) { return count; } @@ -736,7 +736,7 @@ static void imb_exr_get_views(MultiPartInputFile &file, StringVector &views) if (exr_has_multipart_file(file) == false) { if (exr_has_multiview(file)) { StringVector sv = multiView(file.header(0)); - for (StringVector::const_iterator i = sv.begin(); i != sv.end(); i++) { + for (StringVector::const_iterator i = sv.begin(); i != sv.end(); ++i) { views.push_back(*i); } } @@ -1686,7 +1686,7 @@ static void exr_print_filecontents(MultiPartInputFile &file) const StringVector views = multiView(file.header(0)); printf("OpenEXR-load: MultiView file\n"); printf("OpenEXR-load: Default view: %s\n", defaultViewName(views).c_str()); - for (StringVector::const_iterator i = views.begin(); i != views.end(); i++) { + for (StringVector::const_iterator i = views.begin(); i != views.end(); ++i) { printf("OpenEXR-load: Found view %s\n", (*i).c_str()); } } @@ -1701,7 +1701,7 @@ static void exr_print_filecontents(MultiPartInputFile &file) for (int j = 0; j < numparts; j++) { const ChannelList &channels = file.header(j).channels(); - for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); i++) { + for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) { const Channel &channel = i.channel(); printf("OpenEXR-load: Found channel %s of type %d\n", i.name(), channel.type); } @@ -1713,7 +1713,7 @@ static const char *exr_rgba_channelname(MultiPartInputFile &file, const char *ch { const ChannelList &channels = file.header(0).channels(); - for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); i++) { + for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) { /* const Channel &channel = i.channel(); */ /* Not used yet */ const char *str = i.name(); int len = strlen(str); |