OpenLayers OpenLayers

Ticket #585 (closed feature: fixed)

Opened 2 years ago

Last modified 1 year ago

delete row from event cache instead of nullify

Reported by: euzuro Assigned to:
Priority: minor Milestone: 2.4 Release
Component: Events Version:
Keywords: Cc:
State:

Description (Last modified by euzuro)

There is not much difference here but for debugging this is useful (and it is more technically correct)

Basically, if you have an object

 var foo = {
    'x': 1,
    'y': 2,
    'z': 3
 };

and you wish to remove the 'y' property, you can say:

 foo.y = null;

...and that will be fine, the value is gone.

If, however, you wish to totally eliminate it from your object, the proper procedure is:

 delete foo.y;

The difference is that if some day you choose to iterate over the keys in foo, nullifying 'y' will not remove the key 'y'. Calling delete will.

In the patch attached, I make this change so that later, when iterating through in unloadCache(), the keys will not show up if they have been totally removed.

Attachments

delete.patch (0.6 kB) - added by euzuro on 03/29/07 17:02:49.
delete a key who's items are all gone

Change History

03/29/07 17:02:49 changed by euzuro

  • attachment delete.patch added.

delete a key who's items are all gone

03/29/07 17:03:46 changed by euzuro

  • keywords set to review.
  • description changed.

03/29/07 17:13:08 changed by tschaub

  • keywords changed from review to commit.

looks smart, I approve

03/29/07 17:18:11 changed by euzuro

  • status changed from new to closed.
  • resolution set to fixed.

committed with r2929

that's two-nine-two-nine for those of you out there in TV land

07/05/07 16:55:15 changed by euzuro

  • keywords deleted.