commit:     6e316a87828069f19906c5dace6f5215154b52b4
Author:     Kenneth Raplee <kenrap <AT> kennethraplee <DOT> com>
AuthorDate: Tue Mar 22 07:56:35 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 23:06:44 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6e316a87

Use str.join() instead of string concatenation

Joining strings is also faster.

Signed-off-by: Kenneth Raplee <kenrap <AT> kennethraplee.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/_global_updates.py | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/lib/portage/_global_updates.py b/lib/portage/_global_updates.py
index a17ee861d..d7117d36b 100644
--- a/lib/portage/_global_updates.py
+++ b/lib/portage/_global_updates.py
@@ -97,21 +97,18 @@ def _do_global_updates(trees, prev_mtimes, quiet=False, 
if_mtime_changed=True):
                     )
                     if not quiet:
                         writemsg_stdout(
-                            _(
-                                "  %s='update pass'  %s='binary update'  "
-                                "%s='/var/db update'  %s='/var/db move'\n"
-                                "  %s='/var/db SLOT move'  %s='binary move'  "
-                                "%s='binary SLOT move'\n  %s='update 
/etc/portage/package.*'\n"
-                            )
-                            % (
-                                bold("."),
-                                bold("*"),
-                                bold("#"),
-                                bold("@"),
-                                bold("s"),
-                                bold("%"),
-                                bold("S"),
-                                bold("p"),
+                            "  ".join(
+                                (
+                                    "",
+                                    f"{bold('.')}='update pass'",
+                                    f"{bold('*')}='binary update'",
+                                    f"{bold('#')}='/var/db update'",
+                                    f"{bold('@')}='/var/db move'\n",
+                                    f"{bold('s')}='/var/db SLOT move'",
+                                    f"{bold('%')}='binary move'"
+                                    f"{bold('S')}='binary SLOT move'\n",
+                                    f"{bold('p')}='update 
/etc/portage/package.*'\n",
+                                )
                             )
                         )
                 valid_updates, errors = parse_updates(mycontent)

Reply via email to