Permalink
Browse files

Saving some bytes.

  • Loading branch information...
1 parent b715064 commit 55c3334dbe915b477a34f6a7042aad7301afdaa4 Jens Arps committed Feb 18, 2011
Showing with 5 additions and 10 deletions.
  1. +2 −3 features/checkedSet/checkedSet.js
  2. +3 −7 features/wrappedWrites/wrappedWrites.js
@@ -1,9 +1,8 @@
-(function(){
- var oldSet = storage.set;
+(function(oldSet){
storage.set = function(key, value){
oldSet.call(storage, key, value);
return storage.get(key) == value;
};
-})();
+})(storage.set);
@@ -1,5 +1,4 @@
-(function(){
- var oldSet = storage.set;
+(function(oldSet, oldGet, oldClear){
storage.set = function(key, value){
var result = false;
@@ -11,8 +10,6 @@
return result;
};
- var oldRemove = storage.remove;
-
storage.remove = function(key, value){
var result = false;
try{
@@ -23,8 +20,7 @@
return result;
};
- if(storage.clear){
- var oldClear = storage.clear;
+ if(oldClear){
storage.clear = function(key, value){
var result = false;
@@ -37,4 +33,4 @@
};
}
-})();
+})(storage.set, storage.get, storage.clear);

0 comments on commit 55c3334

Please sign in to comment.