$OpenBSD: patch-lib_hiera_backend_yaml_backend_rb,v 1.2 2014/01/24 08:50:43 jasper Exp $

From 1f856c12a46dea7e8278a55371de4c278d0a21ed Mon Sep 17 00:00:00 2001
From: Eric Sorenson <eric.sorenson@puppetlabs.com>
Date: Wed, 23 Oct 2013 17:34:34 -0700
Subject: [PATCH 1/2] (#22142) Substantial speed increase in lookups

From 00be33858e98459e5125d46ea546e91a888b0e6c Mon Sep 17 00:00:00 2001
From: Andrew Parker <andy@puppetlabs.com>
Date: Tue, 10 Dec 2013 11:17:51 -0800
Subject: [PATCH 2/2] (#22142) Extract method to list all hierarchy files

--- lib/hiera/backend/yaml_backend.rb.orig	Fri Jan 24 09:46:46 2014
+++ lib/hiera/backend/yaml_backend.rb	Fri Jan 24 09:47:08 2014
@@ -13,12 +13,7 @@ class Hiera
 
         Hiera.debug("Looking up #{key} in YAML backend")
 
-        Backend.datasources(scope, order_override) do |source|
-          Hiera.debug("Looking for data source #{source}")
-          yamlfile = Backend.datafile(:yaml, scope, source, "yaml") || next
-
-          next unless file_exists?(yamlfile)
-
+        Backend.datasourcefiles(:yaml, scope, "yaml", order_override) do |source, yamlfile|
           data = @cache.read_file(yamlfile, Hash) do |data|
             YAML.load(data) || {}
           end
