Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 8d4fefc

Browse files
committed
code style
1 parent 5b11e30 commit 8d4fefc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Runtime/painting/image_cache.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void clear() {
6767
this._cache.Clear();
6868
this._pendingImages.Clear();
6969
this._currentSizeBytes = 0;
70-
70+
7171
this._lruKeys.Clear();
7272
}
7373

@@ -86,10 +86,12 @@ public bool evict(object key) {
8686
this._lruKeys.Remove(image.node);
8787
return true;
8888
}
89+
8990
return false;
9091
}
9192

92-
public ImageStreamCompleter putIfAbsent(object key, Func<ImageStreamCompleter> loader, ImageErrorListener onError = null) {
93+
public ImageStreamCompleter putIfAbsent(object key, Func<ImageStreamCompleter> loader,
94+
ImageErrorListener onError = null) {
9395
D.assert(key != null);
9496
D.assert(loader != null);
9597

@@ -121,18 +123,18 @@ public ImageStreamCompleter putIfAbsent(object key, Func<ImageStreamCompleter> l
121123
void listener(ImageInfo info, bool syncCall) {
122124
int imageSize = info?.image == null ? 0 : info.image.height * info.image.width * 4;
123125
_CachedImage cachedImage = new _CachedImage(result, imageSize);
124-
126+
125127
if (this.maximumSizeBytes > 0 && imageSize > this.maximumSizeBytes) {
126128
this._maximumSizeBytes = imageSize + 1000;
127129
}
128-
130+
129131
this._currentSizeBytes += imageSize;
130132

131133
if (this._pendingImages.TryGetValue(key, out var loadedPendingImage)) {
132134
loadedPendingImage.removeListener();
133135
this._pendingImages.Remove(key);
134136
}
135-
137+
136138
D.assert(!this._cache.ContainsKey(key));
137139
this._cache[key] = cachedImage;
138140
cachedImage.node = this._lruKeys.AddLast(key);
@@ -172,7 +174,7 @@ public _CachedImage(ImageStreamCompleter completer, int sizeBytes) {
172174
this.completer = completer;
173175
this.sizeBytes = sizeBytes;
174176
}
175-
177+
176178
public ImageStreamCompleter completer;
177179
public int sizeBytes;
178180
public LinkedListNode<object> node;

0 commit comments

Comments
 (0)