repositories
/
e-mobility-charging-stations-simulator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d43a619
)
Allow unbound circular array size
author
Jérôme Benoit
<jerome.benoit@sap.com>
Thu, 13 May 2021 17:41:40 +0000
(19:41 +0200)
committer
Jérôme Benoit
<jerome.benoit@sap.com>
Thu, 13 May 2021 17:41:40 +0000
(19:41 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/CircularArray.ts
patch
|
blob
|
blame
|
history
diff --git
a/src/utils/CircularArray.ts
b/src/utils/CircularArray.ts
index 9fde8be78c159411bf6708c49893bb6f23f9d4c5..3e489f640fe3f4e0ca92091fb1b8adb32b39458a 100644
(file)
--- a/
src/utils/CircularArray.ts
+++ b/
src/utils/CircularArray.ts
@@
-1,11
+1,11
@@
export default class CircularArray<T> extends Array<T> {
public size: number;
- private readonly default
Maximum
CircularArraySize = 2000;
+ private readonly defaultCircularArraySize = 2000;
constructor(size?: number) {
super();
- this.size = size
&& size <= this.defaultMaximumCircularArraySize ? size : this.defaultMaximum
CircularArraySize;
+ this.size = size
?? this.default
CircularArraySize;
}
public push(...items: T[]): number {