Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($cacheFactory) return undefined when removing non-existent cache ent... #1562

Closed
wants to merge 1 commit into from
Closed

Conversation

jtymes
Copy link
Contributor

@jtymes jtymes commented Nov 13, 2012

...ry

Making remove behave like get() when an entry does not exist by returning undefined.

From #1497

@@ -70,6 +70,8 @@ function $CacheFactoryProvider() {
remove: function(key) {
var lruEntry = lruHash[key];

if(!lruEntry) return;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: space after if.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

…entry

Making remove behave like get() when an entry does not exist by returning undefined.
@pkozlowski-opensource
Copy link
Member

@jtymes looks perfect now :-)

@IgorMinar
Copy link
Contributor

thanks a lot of the fix!

for future reference:

  • the commit message is too long (>70chars)
  • there should be : after )
  • the last line should read Closes #1497

otherwise this looks good. I'm going to fix these while merging this.

if you don't have our t-shirt yet please fill out this form http://goo.gl/075Sj

@IgorMinar
Copy link
Contributor

landed as 55d1580

@IgorMinar IgorMinar closed this Nov 24, 2012
@jtymes
Copy link
Contributor Author

jtymes commented Nov 24, 2012

Thanks for those tips and the shirt!

@pkozlowski-opensource
Copy link
Member

@jtymes Thank you for contributing! I saw your comments in many other issues, always very helpful and to the point. Very much appreciated!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants