#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Thu, 23 Feb 2017 15:52:20 +0100
changeset 21553 bd94215744c9
parent 21552 7732a5719d14
child 21554 405eaa2a7109
#TUNING by stefan class: Set added: #isEmptyOrNil #notEmptyOrNil
Set.st
--- a/Set.st	Thu Feb 23 10:58:09 2017 +0100
+++ b/Set.st	Thu Feb 23 15:52:20 2017 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
 	      All Rights Reserved
@@ -1319,6 +1317,14 @@
     ^ tally == 0
 !
 
+isEmptyOrNil
+    "return true if the receiver is empty"
+
+    ^ tally == 0
+
+    "Created: / 23-02-2017 / 15:51:50 / stefan"
+!
+
 isFixedSize
     "return true if the receiver cannot grow - this will vanish once
      Arrays and Strings learn how to grow ..."
@@ -1342,6 +1348,14 @@
     "Created: 12.2.1997 / 12:39:02 / cg"
 !
 
+notEmptyOrNil
+    "return true if the receiver is not empty"
+
+    ^ tally ~~ 0
+
+    "Created: / 23-02-2017 / 15:51:58 / stefan"
+!
+
 occurrencesOf:anObject
     "return the number of occurrences of anObject in the receiver.
      As I am a Set, this can only return 0 or 1."