From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91658 invoked by alias); 14 Apr 2017 15:21:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 91628 invoked by uid 89); 14 Apr 2017 15:21:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 14 Apr 2017 15:21:35 +0000 Received: by simark.ca (Postfix, from userid 33) id DA0951E4A3; Fri, 14 Apr 2017 11:21:35 -0400 (EDT) To: Andreas Arnez Subject: Re: [PATCH 9/9] Remove unnecessary copies of variables in read/write_pieced_value X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 14 Apr 2017 15:21:00 -0000 From: Simon Marchi Cc: gdb-patches@sourceware.org In-Reply-To: <1491586736-21296-10-git-send-email-arnez@linux.vnet.ibm.com> References: <1491586736-21296-1-git-send-email-arnez@linux.vnet.ibm.com> <1491586736-21296-10-git-send-email-arnez@linux.vnet.ibm.com> Message-ID: <3eb8baf276b16a9de3b11e1a6e94582a@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.4 X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00464.txt.bz2 On 2017-04-07 13:38, Andreas Arnez wrote: > In read_pieced_value's main loop, the variables `dest_offset_bits' and > `source_offset_bits' are basically just copies of `offset' and > `bits_to_skip', respectively. In write_pieced_value the copies are > reversed. This is not very helpful when trying to keep the logic > between > these functions in sync. Since the copies are unnecessary, this patch > just removes them. I agree about dest_offset_bits being the same as offset in read_pieced_value and source_offset_bits being the same as offset in write_pieced_value, I had also identified this as a potential simplification. But I'd keep the names source_offset_bits/dest_offset_bits rather than offset. Or maybe offset_in_value_bits, something like that. Also, it might be clearer if bits_to_skip was named source_bits_to_skip in read_pieced_value and dest_bits_to_skip in write_pieced_value, to clarify what is skipped exactly. Thanks, Simon