From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id D75196EC59; Wed, 10 Mar 2021 23:48:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D75196EC59 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615409300; bh=RBw9fIjgeN5DbmQ/y1O/V4sADVabSUurnEsqiJNz+jg=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Ybe5XNRv3oU4Em3Qd641kuCH/j60XPS3sIQnRzzGzpmNWIYBuD6POTlNoORhHFKca ilg2Rg14ZF8g3svVjChmfUb1gzfL5Q+8w8uPx+mvMN3ahwyketpVKM1Fx5xiICS3fg 81OxGhu0ueEC8fsJHBZrlYAee/W0B3bNNmZ9/I3U= Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 62A826EC71 for ; Wed, 10 Mar 2021 23:47:43 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 62A826EC71 Received: by mail-lj1-f179.google.com with SMTP id u18so27413313ljd.3 for ; Wed, 10 Mar 2021 12:47:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z1p3OR663pM9nYhrY5QoIeT4dr7Raj+t9wsv1WP45qU=; b=NwvtfpTuXutILz7jL/lMP5LnD/Rq5Nue9gIidj/4+PuQ5d9aiSqF22YJZDBE/UtRB5 xPKg6A2O71a66JSzLsBiIN/ZMQaMCCG+oUgAJPzN8Bgsw14vDzyI7ojLcbfG7IXRWIpi bUQovpwGl0NtMC2W19nEJzF+VJ2ZAKgY7291/oh0MbA91/BYEHRIHSRG+5i2WdP9OBKT M+/jefbpV1BV0lPHHaCNdHlqJoeIf8AUN/f6shQAsNsMIZo68QFEpax4ayJoClhUA1ZD BIbkTWM0dTFN7qxF9SEzRY5DP1ai0kGdMmcAeEiGdJLxDHCvcbKl9E0wu2DvUuGaW6Cn O7SQ== X-Gm-Message-State: AOAM530+ci4pheoK/M0wudfhsrbKdbo9H3jNC1BqONAOKCweJr6j6VLw XEdYNzEa9HF8mKoxJws+icvNhJWy45XtXQ== X-Google-Smtp-Source: ABdhPJzAT3CT4++hQnVzt0ohcC6vPMVwgmydxFIa1G+Bp43KIZzyWi2i3x6uASI3ib3O3+sC+ZYBiw== X-Received: by 2002:a2e:9b4a:: with SMTP id o10mr2814488ljj.485.1615409262268; Wed, 10 Mar 2021 12:47:42 -0800 (PST) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id q25sm126035lfn.42.2021.03.10.12.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 12:47:41 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 2A6CC560210; Wed, 10 Mar 2021 23:47:17 +0300 (MSK) To: tml Date: Wed, 10 Mar 2021 23:47:10 +0300 Message-Id: <20210310204710.186461-3-gorcunov@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210310204710.186461-1-gorcunov@gmail.com> References: <20210310204710.186461-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 2/2] xlog: do not sort sole entry X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" In case if there only one snapshot or xlog file there is no need to call sorting procedure at all. In-scope-of #5806 Signed-off-by: Cyrill Gorcunov --- src/box/xlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box/xlog.c b/src/box/xlog.c index 974f460be..89df7e485 100644 --- a/src/box/xlog.c +++ b/src/box/xlog.c @@ -588,7 +588,7 @@ xdir_scan(struct xdir *dir, bool is_dir_required) signatures[s_count++] = signature; } /** Sort the list of files */ - if (s_count > 0) + if (s_count > 1) qsort(signatures, s_count, sizeof(*signatures), cmp_i64); /** * Update the log dir index with the current state: -- 2.29.2