Skip to content

Commit d923eea

Browse files
committed
Fix code style
1 parent ea972e6 commit d923eea

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

JavaScript/5-async.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

3-
const duplicate = (factory, n) => (
4-
new Array(n).fill().map(() => factory())
5-
);
3+
const duplicate = (factory, n) => new Array(n).fill().map(() => factory());
64

75
const poolify = (factory, min, norm, max) => {
86
let allocated = norm;

JavaScript/6-poolify.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ const poolified = Symbol('poolified');
44

55
const mixFlag = { [poolified]: true };
66

7-
const duplicate = (factory, n) => (
7+
const duplicate = (factory, n) =>
88
new Array(n).fill().map(() => {
99
const instance = factory();
1010
return Object.assign(instance, mixFlag);
11-
})
12-
);
11+
});
1312

1413
const provide = (callback) => (item) => {
1514
setImmediate(() => {

JavaScript/7-buffer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const poolify = (factory, min, norm, max) => {
1414
console.dir({
1515
action: 'Recycle item',
1616
length: pool.items.length,
17-
allocated: pool.allocated
17+
allocated: pool.allocated,
1818
});
1919
return;
2020
}
@@ -28,7 +28,7 @@ const poolify = (factory, min, norm, max) => {
2828
console.dir({
2929
action: 'Get item',
3030
length: pool.items.length,
31-
allocated: pool.allocated
31+
allocated: pool.allocated,
3232
});
3333
return res;
3434
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy