Ticket #585 (closed feature: fixed)

Opened 6 years ago

Last modified 6 years ago

delete row from event cache instead of nullify

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

Description (last modified by euzuro) (diff)

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 Download (0.6 KB) - added by euzuro 6 years ago.
delete a key who's items are all gone

Change History

Changed 6 years ago by euzuro

delete a key who's items are all gone

Changed 6 years ago by euzuro

  • keywords review added
  • description modified (diff)

Changed 6 years ago by tschaub

  • keywords commit added; review removed

looks smart, I approve

Changed 6 years ago 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

Changed 6 years ago by euzuro

  • keywords commit removed
Note: See TracTickets for help on using tickets.