Re: [PATCH 05/16] replace-object: eliminate replace objects prepared flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 10.04.2018 um 00:45 schrieb Stefan Beller:
> By making the oidmap a pointer, we eliminate the need for
> the global boolean variable 'replace_object_prepared'.
> 
> Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
> ---
>   object-store.h   |  2 +-
>   replace-object.c | 16 +++++++++-------
>   2 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/object-store.h b/object-store.h
> index c04b4c95eb..1ff862c7f9 100644
> --- a/object-store.h
> +++ b/object-store.h
> @@ -99,7 +99,7 @@ struct raw_object_store {
>   	 * Objects that should be substituted by other objects
>   	 * (see git-replace(1)).
>   	 */
> -	struct oidmap replace_map;
> +	struct oidmap *replace_map;

This also allows the '#include "oidmap.h"' introduced in patch 3 to be
replaced by 'struct oidmap;' (forward declaration instead of include).
Keeping the type opaque discourages circumventing accessor functions;
not dragging in other headers avoids some compile time overhead.

René



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux