From 5ffdca3d86cd6fd77d7b91e125c7fd69dbd0f7db Mon Sep 17 00:00:00 2001 From: Benjamin Loison <12752145+Benjamin-Loison@users.noreply.github.com> Date: Sun, 10 Dec 2023 08:55:24 +0100 Subject: [PATCH] fix: Remove unnecessary ending comma on `Share` or `View on the web` (#4887) --- .../lib/helpers/temp_product_list_share_helper.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/smooth_app/lib/helpers/temp_product_list_share_helper.dart b/packages/smooth_app/lib/helpers/temp_product_list_share_helper.dart index 042b1e9d230..4daf5a3af55 100644 --- a/packages/smooth_app/lib/helpers/temp_product_list_share_helper.dart +++ b/packages/smooth_app/lib/helpers/temp_product_list_share_helper.dart @@ -3,15 +3,11 @@ import 'package:smooth_app/query/product_query.dart'; // TODO(m123): Move this to off-dart Uri shareProductList(List barcodes) { - final StringBuffer buffer = StringBuffer(); - - for (final String i in barcodes) { - buffer.write('$i,'); - } + final String barcodesString = barcodes.join(','); return UriHelper.replaceSubdomain( ProductQuery.uriProductHelper.getUri( - path: 'products/$buffer', + path: 'products/$barcodesString', addUserAgentParameters: false, ), language: OpenFoodAPIConfiguration.globalLanguages?.first,