From 9209ec4701d9f6c21d4ae9ebb648d94a1f32665a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 28 Nov 2009 03:19:52 +0100 Subject: tell every method in ftparchive/ that const& is sexy --- ftparchive/override.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'ftparchive/override.cc') diff --git a/ftparchive/override.cc b/ftparchive/override.cc index 6f40bc865..3cf10b89b 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -24,7 +24,7 @@ // Override::ReadOverride - Read the override file /*{{{*/ // --------------------------------------------------------------------- /* This parses the override file and reads it into the map */ -bool Override::ReadOverride(string File,bool Source) +bool Override::ReadOverride(string const &File,bool const &Source) { if (File.empty() == true) return true; @@ -132,7 +132,7 @@ bool Override::ReadOverride(string File,bool Source) // Override::ReadExtraOverride - Read the extra override file /*{{{*/ // --------------------------------------------------------------------- /* This parses the extra override file and reads it into the map */ -bool Override::ReadExtraOverride(string File,bool Source) +bool Override::ReadExtraOverride(string const &File,bool const &Source) { if (File.empty() == true) return true; @@ -209,9 +209,9 @@ bool Override::ReadExtraOverride(string File,bool Source) /* Returns a override item for the given package and the given architecture. * Treats "all" special */ -Override::Item* Override::GetItem(string Package, string Architecture) +Override::Item* Override::GetItem(string const &Package, string const &Architecture) { - map::iterator I = Mapping.find(Package); + map::const_iterator I = Mapping.find(Package); map::iterator J = Mapping.find(Package + "/" + Architecture); if (I == Mapping.end() && J == Mapping.end()) @@ -230,7 +230,7 @@ Override::Item* Override::GetItem(string Package, string Architecture) if (R->Priority != "") result->Priority = R->Priority; if (R->OldMaint != "") result->OldMaint = R->OldMaint; if (R->NewMaint != "") result->NewMaint = R->NewMaint; - for (map::iterator foI = R->FieldOverride.begin(); + for (map::const_iterator foI = R->FieldOverride.begin(); foI != R->FieldOverride.end(); foI++) { result->FieldOverride[foI->first] = foI->second; @@ -247,7 +247,7 @@ Override::Item* Override::GetItem(string Package, string Architecture) there is a rule but it does not match then the empty string is returned, also if there was no rewrite rule the empty string is returned. Failed indicates if there was some kind of problem while rewriting. */ -string Override::Item::SwapMaint(string Orig,bool &Failed) +string Override::Item::SwapMaint(string const &Orig,bool &Failed) { Failed = false; @@ -262,10 +262,10 @@ string Override::Item::SwapMaint(string Orig,bool &Failed) override file. Thus it persists.*/ #if 1 // Break OldMaint up into little bits on double slash boundaries. - string::iterator End = OldMaint.begin(); + string::const_iterator End = OldMaint.begin(); while (1) { - string::iterator Start = End; + string::const_iterator Start = End; for (; End < OldMaint.end() && (End + 3 >= OldMaint.end() || End[0] != ' ' || End[1] != '/' || End[2] != '/'); End++); -- cgit v1.2.3