diff options
| author | Stephen Blott | 2016-03-21 12:30:57 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2016-03-21 12:31:00 +0000 | 
| commit | 741bc131353eb856022d66252309de23a0873fc7 (patch) | |
| tree | dc5f2453155f4ef87c4eeb71247623997fb621cc /lib/utils.coffee | |
| parent | 8783569983d8b3634b1b1eed9b6560dbea5698ab (diff) | |
| download | vimium-741bc131353eb856022d66252309de23a0873fc7.tar.bz2 | |
Simplify singleton handling.
While working on the visual-mode code, it became apparent that our
current "singleton" implementation is unnecessarily complicated.
This simplifies it.  The keys are now required to be strings.
(Previously, they could be any object; which meant we needed to gove
objects an identity.  All of which was complicated.)
Diffstat (limited to 'lib/utils.coffee')
| -rw-r--r-- | lib/utils.coffee | 11 | 
1 files changed, 0 insertions, 11 deletions
| diff --git a/lib/utils.coffee b/lib/utils.coffee index 31f4bec6..60d29998 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -197,17 +197,6 @@ Utils =    # locale-sensitive uppercase detection    hasUpperCase: (s) -> s.toLowerCase() != s -  # Give objects (including elements) distinct identities. -  getIdentity: do -> -    identities = [] - -    (obj) -> -      index = identities.indexOf obj -      if index < 0 -        index = identities.length -        identities.push obj -      "identity-" + index -    # Return a copy of object, but with some of its properties omitted.    copyObjectOmittingProperties: (obj, properties...) ->      obj = extend {}, obj | 
