repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor(simulator): remove unneeded intermediate variable in firmware
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
SharedLRUCache.ts
diff --git
a/src/charging-station/SharedLRUCache.ts
b/src/charging-station/SharedLRUCache.ts
index e235c51d1f930a764c1e2ef8198b792711254b31..6b6df2049117f96a6c3df3881a73a1f4c5ae28fa 100644
(file)
--- a/
src/charging-station/SharedLRUCache.ts
+++ b/
src/charging-station/SharedLRUCache.ts
@@
-1,5
+1,6
@@
import LRUCache from 'mnemonist/lru-map-with-delete';
import LRUCache from 'mnemonist/lru-map-with-delete';
+import { Bootstrap } from '../internal';
import type { ChargingStationConfiguration } from '../types/ChargingStationConfiguration';
import type { ChargingStationTemplate } from '../types/ChargingStationTemplate';
import Utils from '../utils/Utils';
import type { ChargingStationConfiguration } from '../types/ChargingStationConfiguration';
import type { ChargingStationTemplate } from '../types/ChargingStationTemplate';
import Utils from '../utils/Utils';
@@
-16,7
+17,10
@@
export default class SharedLRUCache {
private readonly lruCache: LRUCache<string, CacheableType>;
private constructor() {
private readonly lruCache: LRUCache<string, CacheableType>;
private constructor() {
- this.lruCache = new LRUCache<string, CacheableType>(1000);
+ this.lruCache = new LRUCache<string, CacheableType>(
+ Bootstrap.getInstance().numberOfChargingStationTemplates +
+ Bootstrap.getInstance().numberOfChargingStations
+ );
}
public static getInstance(): SharedLRUCache {
}
public static getInstance(): SharedLRUCache {