From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id A37791FD99 for ; Tue, 23 Aug 2016 21:50:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757902AbcHWVuT (ORCPT ); Tue, 23 Aug 2016 17:50:19 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:58746 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757751AbcHWVuR (ORCPT ); Tue, 23 Aug 2016 17:50:17 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id E974336B73; Tue, 23 Aug 2016 17:47:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=pA4BCO3oK7Eu/gEJ5Bha66YAGPw=; b=aPvYlD YgFFx4TkCX6RjDGPvTCEFxThBer61zbVXvYagxTe6joTO/qdBYwi0mwsx16OyPAY d4K+jageKKSnDBxi5+Vuz/XFoBrsveO//7YseldsSUSY3Be+l4E+BfmOGH5Y1yNC t6OS4VVerCMN76X+vTpOpv4bmGGeNpLTgEZ4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=m0HiZpT8YNOAjwN/nPATW33Psj356CDC jDUIQJPaCebolUf5bBEJbIDGMG71g327Z7uQBYM+jSlbEB6P7unGKltgyzLb36fv lNYWssTzLO0YlyHuuqw41s+K0JSDBncNKxgM5v0BeH3EF0AgnMWrur6cfPxyWIWO tC1umMzUCKs= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id DFD3F36B72; Tue, 23 Aug 2016 17:47:31 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 700B336B71; Tue, 23 Aug 2016 17:47:31 -0400 (EDT) From: Junio C Hamano To: Jeff King Cc: git@vger.kernel.org Subject: Re: [PATCH 2/7] clear_delta_base_cache_entry: use a more descriptive name References: <20160822215725.qdikfcaz3smhulau@sigill.intra.peff.net> <20160822215753.xy7hlho7niex3wpm@sigill.intra.peff.net> Date: Tue, 23 Aug 2016 14:47:29 -0700 In-Reply-To: <20160822215753.xy7hlho7niex3wpm@sigill.intra.peff.net> (Jeff King's message of "Mon, 22 Aug 2016 17:57:53 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 318EA6AE-697B-11E6-8354-FCB17B1B28F4-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Jeff King writes: > The delta base cache entries are stored in a fixed-length > hash table. So the way to remove an entry is to "clear" the > slot in the table, and that is what this function does. > > However, the name is a leaky abstraction. If we were to > change the hash table implementation, it would no longer be > about "clearing". We should name it after _what_ it does, > not _how_ it does it. I.e., something like "remove" instead > of "clear". > > But that does not tell the whole story, either. The subtle > thing about this function is that it removes the entry, but > does not free the entry data. So a more descriptive name is > "detach"; we give ownership of the data buffer to the > caller, and remove any other resources. OK. Sounds sensible.