summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkCanvas.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 2c1038a..9f57971 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -1449,7 +1449,7 @@ CanvasWidgetCmd(
tag = Tk_GetUid(Tcl_GetString(objv[2]));
}
FOR_EVERY_CANVAS_ITEM_MATCHING(objv[2], &searchPtr, goto done) {
- for (i = 0; i < itemPtr->numTags; i++) {
+ for (i = itemPtr->numTags-1; i >= 0; i--) {
if (itemPtr->tagPtr[i] == tag) {
/*
@@ -1462,13 +1462,6 @@ CanvasWidgetCmd(
itemPtr->numTags--;
/*
- * Look at the same place again to deal with the case of
- * successive identical tags matching the tag to delete.
- */
-
- i--;
-
- /*
* There must be no break here: all tags with the same name must
* be deleted.
*/