Signed-off-by: Xu Xijian hdxuxijian@163.com --- src/lib/block_helper.cr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/lib/block_helper.cr b/src/lib/block_helper.cr index 37ad367..596ef7e 100644 --- a/src/lib/block_helper.cr +++ b/src/lib/block_helper.cr @@ -28,9 +28,7 @@ class BlockHelper @block_helper[uuid] = fiber end
- if yield == true - spawn fiber.run - end + spawn fiber.run if yield == true
until fiber.dead? Fiber.yield
On Wed, Nov 25, 2020 at 12:47:47PM +0800, Xu Xijian wrote:
Signed-off-by: Xu Xijian hdxuxijian@163.com
src/lib/block_helper.cr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
block_helper.cr: refactor if block into one line
Thanks sunyukui
diff --git a/src/lib/block_helper.cr b/src/lib/block_helper.cr index 37ad367..596ef7e 100644 --- a/src/lib/block_helper.cr +++ b/src/lib/block_helper.cr @@ -28,9 +28,7 @@ class BlockHelper @block_helper[uuid] = fiber end
- if yield == true
spawn fiber.run
- end
spawn fiber.run if yield == true
until fiber.dead? Fiber.yield
-- 2.23.0
On Wed, Nov 25, 2020 at 02:29:00PM +0800, Sun Yukui wrote:
On Wed, Nov 25, 2020 at 12:47:47PM +0800, Xu Xijian wrote:
Signed-off-by: Xu Xijian hdxuxijian@163.com
src/lib/block_helper.cr | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
block_helper.cr: refactor if block into one line
Good.
Thanks, Xijian
Thanks sunyukui
diff --git a/src/lib/block_helper.cr b/src/lib/block_helper.cr index 37ad367..596ef7e 100644 --- a/src/lib/block_helper.cr +++ b/src/lib/block_helper.cr @@ -28,9 +28,7 @@ class BlockHelper @block_helper[uuid] = fiber end
- if yield == true
spawn fiber.run
- end
spawn fiber.run if yield == true
until fiber.dead? Fiber.yield
-- 2.23.0