| OLD | NEW |
| 1 /** | 1 /** |
| 2 * PriceCache | 2 * PriceCache |
| 3 */ | 3 */ |
| 4 function PriceCache() { | 4 function PriceCache() { |
| 5 } | 5 } |
| 6 | 6 |
| 7 PriceCache.prototype = { | 7 PriceCache.prototype = { |
| 8 getCachedPrice: function(instrumentId) { | 8 getCachedPrice: function(instrumentId) { |
| 9 }, | 9 }, |
| 10 setCachedPrice: function(instrumentId, price) { | 10 setCachedPrice: function(instrumentId, price) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 PriceService.prototype = { | 34 PriceService.prototype = { |
| 35 getPrice: function(instrumentId) { | 35 getPrice: function(instrumentId) { |
| 36 var price = this._priceCache.getCachedPrice(instrumentId); | 36 var price = this._priceCache.getCachedPrice(instrumentId); |
| 37 if(price==null) { | 37 if(price==null) { |
| 38 price = this._priceFetcher.getPriceFromServer(instrument
Id); | 38 price = this._priceFetcher.getPriceFromServer(instrument
Id); |
| 39 this._priceCache.setCachedPrice(instrumentId, price); | 39 this._priceCache.setCachedPrice(instrumentId, price); |
| 40 } | 40 } |
| 41 return price; | 41 return price; |
| 42 } | 42 } |
| 43 } | 43 } |
| OLD | NEW |