From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS7465 200.198.160.0/20 X-Spam-Status: No, score=-1.6 required=3.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD, SPF_PASS,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: raindrops-public@bogomips.org Received: from mail.softwarelivre.org (mail.softwarelivre.org [200.198.173.180]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0525220455 for ; Tue, 23 Feb 2016 11:00:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.softwarelivre.org (Postfix) with ESMTP id E40377C0CC0; Tue, 23 Feb 2016 08:00:56 -0300 (BRT) Received: from mail.softwarelivre.org ([127.0.0.1]) by localhost (mail.softwarelivre.org [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id isvQ5x0uD5sm; Tue, 23 Feb 2016 08:00:56 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by mail.softwarelivre.org (Postfix) with ESMTP id 2EA6E7C0CC2; Tue, 23 Feb 2016 08:00:56 -0300 (BRT) X-Virus-Scanned: amavisd-new at mail.softwarelivre.org Received: from mail.softwarelivre.org ([127.0.0.1]) by localhost (mail.softwarelivre.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ih2UrJ9o8oEs; Tue, 23 Feb 2016 08:00:56 -0300 (BRT) Received: from winterfell.analizo.org (li627-17.members.linode.com [198.58.116.17]) by mail.softwarelivre.org (Postfix) with ESMTPSA id D09E27C0CC0; Tue, 23 Feb 2016 08:00:55 -0300 (BRT) Received: from localhost (unknown [191.250.109.247]) by winterfell.analizo.org (Postfix) with ESMTPSA id 343A44DFC9; Tue, 23 Feb 2016 08:00:51 -0300 (BRT) Date: Tue, 23 Feb 2016 08:00:48 -0300 From: Antonio Terceiro To: Eric Wong Cc: raindrops-public@bogomips.org Subject: Re: [RFC 2/1] linux: remove Pathname stdlib dependency Message-ID: <20160223110048.GC31015@softwarelivre.org> References: <20160202183136.21549-1-e@80x24.org> <20160223020434.GA9948@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="VywGB/WGlW4DM4P8"; micalg="pgp-sha256"; protocol="application/pgp-signature" Content-Disposition: inline In-Reply-To: <20160223020434.GA9948@dcvr.yhbt.net> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: --VywGB/WGlW4DM4P8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 23, 2016 at 02:04:34AM +0000, Eric Wong wrote: > The File.readlink has been available since the earliest SVN import > of Ruby from Jan 16 1998. There's no reason to load the Pathname > class here since we don't do any further pathname manipulation. >=20 > So avoid loading the extra .so here and creating extra objects. > --- > Noticed while reviewing "[RFC] linux: workaround Ruby 2.3 change" > http://bogomips.org/raindrops-public/20160202183136.21549-1-e@80x24.org/= raw >=20 > lib/raindrops/linux.rb | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/lib/raindrops/linux.rb b/lib/raindrops/linux.rb > index a38fa64..4166ec7 100644 > --- a/lib/raindrops/linux.rb > +++ b/lib/raindrops/linux.rb > @@ -8,7 +8,6 @@ > # Instead of snapshotting, Raindrops::Aggregate::LastDataRecv may be used > # to aggregate statistics from +all+ accepted sockets as they arrive > # based on the +last_data_recv+ field in Raindrops::TCP_Info > -require 'pathname' > =20 > module Raindrops::Linux > =20 > @@ -46,7 +45,7 @@ module Raindrops::Linux > path.force_encoding(Encoding::BINARY) if defined?(Encoding) > if File.symlink?(path) > link =3D path > - path =3D Pathname.new(link).realpath.to_s > + path =3D File.readlink(link) > path.force_encoding(Encoding::BINARY) if defined?(Encoding) > rv[link] =3D rv[path] # vivify ListenerStats > else > --=20 > EW LGTM --VywGB/WGlW4DM4P8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCAAGBQJWzDvgAAoJEPwNsbvNRgve/ocQAOjQ9uqLa6kOJatrDxoM4xjS qXKqtmOWn7w0w6HhuDNDHcJYdn+9Ukjmvol3BgFRL5yThmOM7cFtIHo6jbk5vNE9 t179aOa+uQAncCceJAVqeLMJu/LslJvcNi02DIsrxYkn6H9QmtOpRJGw5bdsUtHo m8zw2sLl6ERaFby0269qTvO1PztGHhchQpgjiUtwfQ23k1BIiOHDFYkfcvNkrWjT 81IFuvKQKPkLuW0Y2updsLx+Qwy4RIyprZt2q6yrv2UybEmbURDudoCso2SxGSjI /r08Cy6vHqcNKfGbzPWvRLhP3iH+ce+JbWbWsVgQ4VaZXLjL+icpdzH3WZUVE1xH AHakJf+XQaJ9FYhAjkIZ2lSdIpsDsGDgeE+/cvlRGl4hvt5DU1jfE7BVT5LdUqql +X2N7Pr2maMNzl24uwtTGXMnftgnGSQ7caXifG06a94F9KgQj9tvKBsJ0hXhQzBh 1TrBs15dUkmv90vGwekNMtS5U/qfYXOgLe8ULJ+58oKIRcXf19lKMOLtg+VANRvZ HejZh3JbPvI5lNcWoTyimlio10tl/nAAcA+p3+TwLd/1f42d0KP8g1cmf2kN2B4k qkxDTQOXrMGY4MNX/2K0JKs7AXMqOvVvdM6g39sl5XDc2Zxln6+qWP8IShs7CaWF luJOEd5IHRSq08sG1nYz =D28T -----END PGP SIGNATURE----- --VywGB/WGlW4DM4P8--