From patchwork Tue Nov 24 16:47:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Fotengauer-Malinovskiy X-Patchwork-Id: 548156 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 278591401E7 for ; Wed, 25 Nov 2015 03:47:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=Px6iwDfv; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; q=dns; s=default; b=K1O/GXwM21sXfkTI iFS1f5yMHkZqJWcmzl9BtmpVpWZ5PNzsEti+ynGJ3btMddppSSHY0OukZ6bww3jW OHkG1cqQHcAwj2iyq5M2Fd/upzD8CEBQZsGEqvFx106NI/pDuTYzPGdy506tLHGO VVZhaCtcoNc63BXFi06zHMPEJak= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id :mime-version:content-type; s=default; bh=MQHsSFf5JbOBuh3JYgMmGw H+WKI=; b=Px6iwDfvgBTb+3BPsqUWM9mJBUA1JffksrqDPo4y3w9plO2cHpTWGy SZG3azo0JEdnwXTJfx4jzJyx1BCEhhB8/UZ+tXS4bJ9bIXNeEJOIQQ10ySh8CkQv EyqBFhT06+KTKIqx4iVhN2eoMS3hY6t2r7kbCmkOXjddcPHCoXn/o= Received: (qmail 47471 invoked by alias); 24 Nov 2015 16:47:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 47460 invoked by uid 89); 24 Nov 2015 16:47:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: pegasus3.altlinux.org Date: Tue, 24 Nov 2015 19:47:01 +0300 From: Gleb Fotengauer-Malinovskiy To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: [PATCH v2] malloc: remove redundant getenv call Message-ID: <20151124164701.GE25138@glebfm.cloud.tilaa.com> MIME-Version: 1.0 Content-Disposition: inline * malloc/memusage.c (me): Remove redundant getenv call. --- malloc/memusage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 2015-11-24 Gleb Fotengauer-Malinovskiy * malloc/memusage.c (me): Remove redundant getenv call. -- glebfm diff --git a/malloc/memusage.c b/malloc/memusage.c index a57ba8e..6de3344 100644 --- a/malloc/memusage.c +++ b/malloc/memusage.c @@ -276,9 +276,10 @@ me (void) /* Determine the buffer size. We use the default if the environment variable is not present. */ buffer_size = DEFAULT_BUFFER_SIZE; - if (getenv ("MEMUSAGE_BUFFER_SIZE") != NULL) + const char *str_buffer_size = getenv ("MEMUSAGE_BUFFER_SIZE"); + if (str_buffer_size != NULL) { - buffer_size = atoi (getenv ("MEMUSAGE_BUFFER_SIZE")); + buffer_size = atoi (str_buffer_size); if (buffer_size == 0 || buffer_size > DEFAULT_BUFFER_SIZE) buffer_size = DEFAULT_BUFFER_SIZE; }