From e4958f975748b1f22d2ac36269ef36a73ce8f3d2 Mon Sep 17 00:00:00 2001 From: karthic rao Date: Fri, 13 May 2016 16:03:53 +0530 Subject: [PATCH] Removing regexp check and adding string based check, regexp check was unnecessary here (#1627) --- posix-utils.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/posix-utils.go b/posix-utils.go index 7fa8570c9..493eae578 100644 --- a/posix-utils.go +++ b/posix-utils.go @@ -17,19 +17,15 @@ package main import ( - "regexp" "runtime" "strings" "unicode/utf8" ) -// validVolname regexp. -var validVolname = regexp.MustCompile(`^.{3,63}$`) - // isValidVolname verifies a volname name in accordance with object // layer requirements. func isValidVolname(volname string) bool { - if !validVolname.MatchString(volname) { + if len(volname) < 3 || len(volname) > 63 { return false } switch runtime.GOOS {