diff options
author | Eike Rathke <erack@redhat.com> | 2018-02-21 15:13:11 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2018-02-21 15:21:14 +0100 |
commit | 581b845509d20fa864b00088ed649f30fe4e1109 (patch) | |
tree | 4bd74f94a6d7309ad8dda026b140137556d714f3 /sc/inc/table.hxx | |
parent | ef03e3a36f821e9d85f08cb06e72dc32fbbaade9 (diff) |
Pass ScColumnsRange::Iterator as const&
Specifically for each operator==() call two temporaries were
copied, for operator!=() even twice as much.. in
for(...:GetColumnsRange())
Change-Id: I4b426ae855454544e50efca35aa73303138f7ba7
Diffstat (limited to 'sc/inc/table.hxx')
-rw-r--r-- | sc/inc/table.hxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index c3c65a0b81d5..b7d6c344e57f 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -131,17 +131,17 @@ class ScColumnsRange final typedef const SCCOL* pointer; typedef SCCOL reference; - explicit Iterator(std::vector<ScColumn*>::const_iterator colIter) : maColIter(colIter) {} + explicit Iterator(const std::vector<ScColumn*>::const_iterator& colIter) : maColIter(colIter) {} Iterator& operator++() { maColIter++; return *this;} Iterator& operator--() { maColIter--; return *this;} - bool operator==(Iterator other) const {return maColIter == other.maColIter;} - bool operator!=(Iterator other) const {return !(*this == other);} + bool operator==(const Iterator & rOther) const {return maColIter == rOther.maColIter;} + bool operator!=(const Iterator & rOther) const {return !(*this == rOther);} SCCOL operator*() const {return (*maColIter)->GetCol();} }; - ScColumnsRange(Iterator nBegin, Iterator nEnd) : maBegin(nBegin), maEnd(nEnd) {} + ScColumnsRange(const Iterator & rBegin, const Iterator & rEnd) : maBegin(rBegin), maEnd(rEnd) {} const Iterator & begin() { return maBegin; } const Iterator & end() { return maEnd; } std::reverse_iterator<Iterator> rbegin() { return std::reverse_iterator<Iterator>(maEnd); } |