| Summary: | const in adviseFast incorrect should removed | ||
|---|---|---|---|
| Product: | [Applications] kmines | Reporter: | Garrett Kajmowicz <gkajmowi> |
| Component: | general | Assignee: | Hadacek Nicolas <hadacek> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Garrett Kajmowicz
2005-08-22 22:53:14 UTC
diff -ru kdegames-3.4.2/kmines/solver/adviseFast.cpp kdegames-3.4.2-gk/kmines/solver/adviseFast.cpp
--- kdegames-3.4.2/kmines/solver/adviseFast.cpp 2005-05-23 08:05:21.000000000 -0400
+++ kdegames-3.4.2-gk/kmines/solver/adviseFast.cpp 2005-08-22 16:44:51.000000000 -0400
@@ -131,7 +131,7 @@
// at least one fact, but don't want to waste time
// proving it :)
if(_containingFacts.count(*i)){
- CoordSet const &affF = _containingFacts[*i];
+ CoordSet &affF = _containingFacts[*i];
affectedFacts->insert(
affF.begin(), affF.end());
for( j=affF.begin();
@@ -163,7 +163,7 @@
// at least one fact, but don't want to waste time
// proving it :)
if(_containingFacts.count(point)){
- CoordSet const &affF = _containingFacts[point];
+ CoordSet &affF = _containingFacts[point];
affectedFacts->insert(affF.begin(), affF.end());
CoordSet::iterator i;
for(i=affF.begin(); i!=affF.end(); ++i){
I just commited this patch (this really ought to be const_iterator afaik)
Index: solver/adviseFast.cpp
===================================================================
--- solver/adviseFast.cpp (revision 453254)
+++ solver/adviseFast.cpp (working copy)
@@ -124,7 +124,7 @@
autorevealed.insert(point);
affectedFacts->insert(autorevealed.begin(), autorevealed.end());
- CoordSet::iterator i, j;
+ CoordSet::const_iterator i;
for(i=autorevealed.begin(); i!=autorevealed.end(); ++i)
{
// I still think that each poing will belong to
@@ -134,7 +134,7 @@
CoordSet const &affF = _containingFacts[*i];
affectedFacts->insert(
affF.begin(), affF.end());
- for( j=affF.begin();
+ for(CoordSet::const_iterator j=affF.begin();
j!=affF.end();
++j)
{
@@ -165,8 +165,7 @@
if(_containingFacts.count(point)){
CoordSet const &affF = _containingFacts[point];
affectedFacts->insert(affF.begin(), affF.end());
- CoordSet::iterator i;
- for(i=affF.begin(); i!=affF.end(); ++i){
+ for(CoordSet::const_iterator i=affF.begin(); i!=affF.end(); ++i){
(*this)[*i].pointSet.erase(point);
(*this)[*i].mines--;
if((*this)[*i].pointSet.empty())
|