From 8176b13718902d1a4b796630832fb1476d7dbbd1 Mon Sep 17 00:00:00 2001 From: Eric Amorde Date: Mon, 18 Jun 2018 21:31:32 -0700 Subject: [PATCH] Only require 'digest' once instead of on every call of `uuid_for_path` --- CHANGELOG.md | 4 ++++ lib/xcodeproj/project/uuid_generator.rb | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f05171de..0a4c5970f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ ##### Bug Fixes +* Only `require 'digest'` once instead of per call to `uuid_for_path` + [Eric Amorde](https://github.com/amorde) + [#580](https://github.com/CocoaPods/Xcodeproj/pull/580) + * Xcode 10 support for input file list and output file list [Dimitris Koutsogiorgas](https://github.com/dnkoutso) [#7835](https://github.com/CocoaPods/CocoaPods/issues/7835) diff --git a/lib/xcodeproj/project/uuid_generator.rb b/lib/xcodeproj/project/uuid_generator.rb index 8fe351ca1..3d7a968eb 100644 --- a/lib/xcodeproj/project/uuid_generator.rb +++ b/lib/xcodeproj/project/uuid_generator.rb @@ -1,6 +1,8 @@ module Xcodeproj class Project class UUIDGenerator + require 'digest' + def initialize(project) @project = project @new_objects_by_uuid = {} @@ -76,7 +78,6 @@ def switch_uuids(objects) end def uuid_for_path(path) - require 'digest' Digest::MD5.hexdigest(path).upcase end