Jetsam suggestion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Jetsam suggestion

Sebastian Sastre-2
HI there,
 
    I saw that:
 
WARegistry>>clearHandlers
 | handlers |
 self mutex critical: [
  handlers := handlersByKey.
  handlersByKey := SeasidePlatformSupport reducedConflictDictionary new.
  keysByHandler := SeasidePlatformSupport reducedConflictDictionary new ].
 handlers ifNotNil: [
  [ handlers do: [ :each | each unregistered ] ]
   fork ]
 
become overriden to:
 
 | handlers |
 self mutex critical: [
  handlers := handlersByKey.
  handlersByKey := SeasidePlatformSupport reducedConflictDictionary new.
  keysByHandler := SeasidePlatformSupport reducedConflictDictionary new ].
 handlers ifNotNil: [
  [ handlers do: [ :each | each unregistered ] ]
   fork ].
  
 ^ handlers size
 
code which in fact provides annoyances when handlers is nil. So my suggestion is:
 
 | handlers |
 self mutex critical: [
  handlers := handlersByKey.
  handlersByKey := SeasidePlatformSupport reducedConflictDictionary new.
  keysByHandler := SeasidePlatformSupport reducedConflictDictionary new ].
 handlers ifNotNil: [
  [ handlers do: [ :each | each unregistered ] ]
   fork ].
  
 ^ handlers ifNil:[nil] ifNotNil:[handlers size]
 
    cheers,
 

Sebastian Sastre

 

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside