Last batch of C++11 range-based for loops (#816)

This commit is contained in:
J-P Nurmi
2015-02-26 10:52:56 +01:00
parent 05c96a16d1
commit 1d09b41540
8 changed files with 47 additions and 57 deletions
+7 -7
View File
@@ -66,11 +66,11 @@ CBuffer::size_type CBuffer::AddLine(const CString& sFormat, const CString& sText
}
CBuffer::size_type CBuffer::UpdateLine(const CString& sMatch, const CString& sFormat, const CString& sText) {
for (iterator it = begin(); it != end(); ++it) {
if (it->GetFormat().compare(0, sMatch.length(), sMatch) == 0) {
it->SetFormat(sFormat);
it->SetText(sText);
it->UpdateTime();
for (CBufLine& Line : *this) {
if (Line.GetFormat().compare(0, sMatch.length(), sMatch) == 0) {
Line.SetFormat(sFormat);
Line.SetText(sText);
Line.UpdateTime();
return size();
}
}
@@ -79,8 +79,8 @@ CBuffer::size_type CBuffer::UpdateLine(const CString& sMatch, const CString& sFo
}
CBuffer::size_type CBuffer::UpdateExactLine(const CString& sFormat, const CString& sText) {
for (iterator it = begin(); it != end(); ++it) {
if (it->GetFormat() == sFormat && it->GetText() == sText) {
for (const CBufLine& Line : *this) {
if (Line.GetFormat() == sFormat && Line.GetText() == sText) {
return size();
}
}