summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPhInstance.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-18 12:44:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-01-18 12:44:22 (GMT)
commit753db19e229dee07fff2c555ce3f355f53131eaf (patch)
treef00289fc7ee4cef9794d712add3048d86320a16e /generic/tkImgPhInstance.c
parentdb94273edeb9157346a4d8711154722c2ce7841d (diff)
downloadtk-753db19e229dee07fff2c555ce3f355f53131eaf.zip
tk-753db19e229dee07fff2c555ce3f355f53131eaf.tar.gz
tk-753db19e229dee07fff2c555ce3f355f53131eaf.tar.bz2
Change more refCount checks to the form "(...refCount-- <= 1)", so no separate decrement and compare is necessary. This allows (in the future) the same code to work when refCount becomes unsigned (which at least doubles the range). No functional change.
Diffstat (limited to 'generic/tkImgPhInstance.c')
-rw-r--r--generic/tkImgPhInstance.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/generic/tkImgPhInstance.c b/generic/tkImgPhInstance.c
index bd152f2..98aaeab 100644
--- a/generic/tkImgPhInstance.c
+++ b/generic/tkImgPhInstance.c
@@ -721,8 +721,7 @@ TkImgPhotoFree(
PhotoInstance *instancePtr = clientData;
ColorTable *colorPtr;
- instancePtr->refCount -= 1;
- if (instancePtr->refCount > 0) {
+ if (instancePtr->refCount-- > 1) {
return;
}