From 261fd197c325bdeae69eb1fe9525b967303399ce Mon Sep 17 00:00:00 2001 From: Duologic Date: Mon, 12 Feb 2024 10:32:46 +0100 Subject: [PATCH] refactor(ascii): remove unnecessary if-conditional --- ascii.libsonnet | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/ascii.libsonnet b/ascii.libsonnet index 28571ac..cd50360 100644 --- a/ascii.libsonnet +++ b/ascii.libsonnet @@ -13,27 +13,17 @@ local d = import 'doc-util/main.libsonnet'; '`isLower` reports whether ASCII character `c` is a lower case letter', [d.arg('c', d.T.string)] ), - isLower(c): - if cp(c) >= 97 && cp(c) < 123 - then true - else false, + isLower(c): cp(c) >= 97 && cp(c) < 123, '#isUpper':: d.fn( '`isUpper` reports whether ASCII character `c` is a upper case letter', [d.arg('c', d.T.string)] ), - isUpper(c): - if cp(c) >= 65 && cp(c) < 91 - then true - else false, + isUpper(c): cp(c) >= 65 && cp(c) < 91, '#isNumber':: d.fn( '`isNumber` reports whether character `c` is a number.', [d.arg('c', d.T.string)] ), - isNumber(c): - if std.isNumber(c) || (cp(c) >= 48 && cp(c) < 58) - then true - else false, - + isNumber(c): std.isNumber(c) || (cp(c) >= 48 && cp(c) < 58), }