From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by gnuweeb.org (Postfix) with ESMTPSA id EE7C981132 for ; Wed, 19 Oct 2022 22:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666219473; bh=czIMryBfuXBATxxkk8qMvYwsb35wvO7fCf0eXIcG2/k=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LwaSXMnyQYkKwD6FeuWZKo9xO7O/LYFiqZsPN739ClbBobKTapGrklRzQvJQAGE9V V4oZmk6AK5YX8+Yz6FQf5yGcMEMIOs2LgJ3S76r26v9EEQqIpMrz2A01iZXngwL63u hQ9+5I8ZHIQw2hm0AUiyBE3GSOcLaLeng5ZQLbT+As6/fYIGgohYr0fTB6kRs8sFL/ ogLM8X/5bbLgw89S+Ivrvsx2ZGh4J33iQAqlEwqnkBYWcK0NHOB6pLbRfJ7801aJW4 UPnG4KObPw5a+RafPXu6scQ1CQbaKTn3+yiPtBPSJMN5z/A3RAAo3Oo6QNFfNb8zbC Hs0Tu9+i8Orag== Received: by mail-lf1-f41.google.com with SMTP id g7so25468332lfv.5 for ; Wed, 19 Oct 2022 15:44:33 -0700 (PDT) X-Gm-Message-State: ACrzQf2QT74wYz1O2ziKj5rUBQb0oPMxi33k6NdsDb1WQqj7d23EF55L TcQRoIC/OxjcdsCCiIFKjupOONWsLTmIKzfS49I= X-Google-Smtp-Source: AMsMyM4OfPJWfeiAkDNTIUiOOTycqK0ZGlQ+Yk09Aqq1mNoKMwE6hrOZXk8eW2q0W5+JY0/fx9OHwT2fsHZ5F8A6Jo0= X-Received: by 2002:ac2:5551:0:b0:4a2:4014:aeb8 with SMTP id l17-20020ac25551000000b004a24014aeb8mr3433914lfk.655.1666219471945; Wed, 19 Oct 2022 15:44:31 -0700 (PDT) MIME-Version: 1.0 References: <20221018081635.1617-1-kiizuha@gnuweeb.org> <20221018081635.1617-5-kiizuha@gnuweeb.org> In-Reply-To: <20221018081635.1617-5-kiizuha@gnuweeb.org> From: Alviro Iskandar Setiawan Date: Thu, 20 Oct 2022 05:44:20 +0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 4/7] atom: Improve fix_utf8_char() To: Muhammad Rizki Cc: Ammar Faizi , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" List-Id: On Tue, Oct 18, 2022 at 3:16 PM Muhammad Rizki wrote: > Improvement on the fix_utf8_char() and change the logic at the > create_template(). Use the `platform == "discord"` to clean html escape. > > Signed-off-by: Muhammad Rizki tq for the patch Instead of having platform == "discord" (string compare), can you make them integer constant? e.g.: enum { PL_TELEGRAM = 1 PL_DISCORD = 2 }; which is much cheaper to compare than string. IDK about enum in Python, maybe just a global constant var or class property that does the same thing? -- Viro