mirror of
https://github.com/znc/znc.git
synced 2026-06-28 05:51:50 +02:00
Last batch of C++11 range-based for loops (#816)
This commit is contained in:
+7
-7
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user