From 4eef6dbf3789502205c254314f27ef33af549adc Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 26 Mar 2017 05:40:21 -0400 Subject: [PATCH] Make IO::Spec::Unix.is-absolute about 4.4x faster --- src/core/IO/Spec/Unix.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/IO/Spec/Unix.pm b/src/core/IO/Spec/Unix.pm index bec25ccd69e..a9e953bf0a2 100644 --- a/src/core/IO/Spec/Unix.pm +++ b/src/core/IO/Spec/Unix.pm @@ -93,8 +93,8 @@ my class IO::Spec::Unix is IO::Spec { ) ?? $io !! IO::Path.new("."); } - method is-absolute( $file ) { - substr( $file, 0, 1 ) eq '/'; + method is-absolute( Str() \path ) { + nqp::p6bool(nqp::eqat(path, '/', 0)); } method path {