c++: code refactoring. 63/98163/1
authorHermet Park <hermet@hermet.pe.kr>
Wed, 16 Nov 2016 09:31:04 +0000 (18:31 +0900)
committerHermet Park <hermet@hermet.pe.kr>
Wed, 16 Nov 2016 09:31:04 +0000 (18:31 +0900)
apply const-iterator as possible.

Change-Id: Ie88a72d9ee9c150801670b7b65a533ef2083bfa9

src/lib/interface/UiIfaceViewmgr.cpp

index 0611b6c9bf19f82a566df96d934e72441e245cb4..0370cc937a3292b83c24f08de2b1935a57debba1 100644 (file)
@@ -323,7 +323,7 @@ int UiIfaceViewmgrImpl::insertViewBefore(UiIfaceView *view, UiIfaceView *before)
        }
 
        if (this->_viewList.size() > 0) {
-               for (auto it = this->_viewList.begin(); it != this->_viewList.end(); it++) {
+               for (auto it = this->_viewList.cbegin(); it != this->_viewList.cend(); it++) {
                        if (before == *it) {
                                this->_viewList.insert(it, view);
                                return UI_VIEWMGR_ERROR_NONE;
@@ -352,7 +352,7 @@ UiIfaceView *UiIfaceViewmgrImpl::getView(unsigned int idx) noexcept
                return nullptr;
        }
 
-       auto it = this->_viewList.begin();
+       auto it = this->_viewList.cbegin();
        advance(it, idx);
 
        set_last_result(UI_VIEWMGR_ERROR_NONE);