Memoize the filter_path method for performance
Memoize the filter_path method for performance

Josh pointed out we repeatedly parse the path given to the
RegistryValuePath and RegistryKeyPath class instances.  This is
concerning because of the number of regular expressions we perform in
the filtering of the input path.

This patch provides a small optimization that simply stores the result
of a filter_path method call and re-uses this result on any subsequent
calls.

This is a simple fix because the only want to "set" the input path is to
instantiate a new instance of the class, passing a new path to the
initializer.

DSI-Ville-Noumea/puppetlabs-registry,zshahan/puppetlabs-registry,ferventcoder/puppetlabs-registry,cyberious/puppetlabs-registry,puppetlabs/puppetlabs-registry,jpogran/puppetlabs-registry,MelanieGault/puppetlabs-registry