From 9a5022514f0767222e3a3496abceef959f92f1d4 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Thu, 14 Mar 2019 16:47:23 -0700 Subject: [PATCH] builtin_argparse: use std::swap --- src/builtin_argparse.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/builtin_argparse.cpp b/src/builtin_argparse.cpp index 4490ae7d2..9c6d930a3 100644 --- a/src/builtin_argparse.cpp +++ b/src/builtin_argparse.cpp @@ -105,9 +105,7 @@ static int check_for_mutually_exclusive_flags(const argparse_cmd_opts_t &opts, // We want the flag order to be deterministic. Primarily to make unit // testing easier. if (flag1 > flag2) { - wcstring tmp(flag1); - flag1 = flag2; - flag2 = tmp; + std::swap(flag1, flag2); } streams.err.append_format( _(L"%ls: Mutually exclusive flags '%ls' and `%ls` seen\n"),