Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEIKS-0000rk-VR for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2020 20:29:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kEIKR-000356-Sp for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Sep 2020 20:28:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEIKR-00034z-I4 for pgsql-hackers@lists.postgresql.org; Fri, 04 Sep 2020 20:28:59 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kEIKL-0007I2-3G for pgsql-hackers@postgresql.org; Fri, 04 Sep 2020 20:28:58 +0000 Received: by mail-qt1-x841.google.com with SMTP id b3so5639942qtg.13 for ; Fri, 04 Sep 2020 13:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=XeqZ8Y1hewmumny4i/dEYIuxHAp4Kpr6WmoCcFLVXA8=; b=G0uWQYrxNdFv2TNvxTrBy7WuRj2ZZx1dCwzj96WQKfbpkz2EgjOQS/70+qLpouqyho 1sd/x5/6vf6tLyxeG5SavFrYotKyHgYntTWzX+Dd3bncxu5z6ufc/f3zxr6iQsdQmvaP slHZuO1+63c8tC6DzRP48Wwx6FrdhZOsNoRsbWntBI5OhSiFLgTH8Z8mAD4UYdoqHKyy CQU+4AX/Clg/GHqrmBg0BoX3taBuqnPUZvpGoAKDd0LB5zCfD/zL/yXyabLEvqSn42FF WM4+zqsRJOBSgm1lsd934aEBVwFLxfayl2oUZyjjuxDdkFTQNoJOwKCS2IelEEKTyn+s iy+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=XeqZ8Y1hewmumny4i/dEYIuxHAp4Kpr6WmoCcFLVXA8=; b=jcl/2/T+WdfxORlTtqHNIAWUjAJfdG6Ifyz1KLUub4ZT4YXNczdZy8XPgnkjTcoKI1 ABi38jOpWFfNE7NyBFZXgHbQtOtGl0qvJwbT4ObDduHIvhRji7CMqWgfQxi3p2yEQVB9 7bJ22oN0/eeSE7kynacNhfy/EzFHv8oajORmip597zl+7yBoLlCaq1vdy53XYuVP36VJ lj9nY7B/YULobWb4a56worbCl24PV7TRNoIBlw1obZPfGYTQ5jFlwcvb62MkzZk7rY3w WIKbLAG/w33LPYt+i5RGLiwHtaTRNw5/bf8SABarr6fDPdINhjphQqexn14p3PesbuS1 1cDw== X-Gm-Message-State: AOAM533P4Fr8y/xBxVF/atdWE2efTDuTNU8XVLvhKP3UVwRleHDw7Krs eXrTnG00rB51v6tNw6lcrNJvcA== X-Google-Smtp-Source: ABdhPJyppaj6O5fx61Tek+iPe82VjBQ/Od9e4LDCqjnwWHn8NH1mIph3wPoV9yK1jhRxzS7B8lS3yQ== X-Received: by 2002:ac8:7a6b:: with SMTP id w11mr9692501qtt.316.1599251331438; Fri, 04 Sep 2020 13:28:51 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.19.47]) by smtp.gmail.com with ESMTPSA id d76sm5351947qkc.81.2020.09.04.13.28.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Sep 2020 13:28:50 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 42E212A1549; Fri, 4 Sep 2020 16:28:49 -0400 (-04) Date: Fri, 4 Sep 2020 16:28:49 -0400 From: Alvaro Herrera To: Juan =?iso-8859-1?Q?Jos=E9_Santamar=EDa?= Flecha Cc: Thomas Munro , Tom Lane , pgsql-hackers Subject: Re: A micro-optimisation for walkdir() Message-ID: <20200904202849.GA17763@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Sep-04, Juan José Santamaría Flecha wrote: > On Fri, Sep 4, 2020 at 9:37 PM Alvaro Herrera > wrote: > > > On 2020-Sep-04, Thomas Munro wrote: > > > > > > +/* File types for 'd_type'. */ > > > +enum > > > + { > > > + DT_UNKNOWN = 0, > > > +# define DT_UNKNOWN DT_UNKNOWN > > > > Uhm ... what do these #defines do? They look a bit funny. > > > > Would it make sense to give this enum a name, and then use that name in > > struct dirent's definition, instead of unsigned char? > > They mimic POSIX dirent.h. I would rather stick to that. Ah ... they do? If you remove the #define lines, what happens to your patch? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services