diff --git a/pxr/usd/ar/defaultResolverContext.cpp b/pxr/usd/ar/defaultResolverContext.cpp index 12872c43e4..cfdd15e5c4 100644 --- a/pxr/usd/ar/defaultResolverContext.cpp +++ b/pxr/usd/ar/defaultResolverContext.cpp @@ -30,8 +30,6 @@ #include "pxr/base/tf/pathUtils.h" #include "pxr/base/tf/stringUtils.h" -#include - PXR_NAMESPACE_OPEN_SCOPE ArDefaultResolverContext::ArDefaultResolverContext( @@ -91,11 +89,7 @@ ArDefaultResolverContext::GetAsString() const size_t hash_value(const ArDefaultResolverContext& context) { - size_t hash = 0; - for (const std::string& p : context.GetSearchPath()) { - boost::hash_combine(hash, TfHash()(p)); - } - return hash; + return TfHash()(context.GetSearchPath()); } PXR_NAMESPACE_CLOSE_SCOPE diff --git a/pxr/usd/ar/testenv/testArDefaultResolver.py b/pxr/usd/ar/testenv/testArDefaultResolver.py index 46bfd472bd..1bc316f906 100644 --- a/pxr/usd/ar/testenv/testArDefaultResolver.py +++ b/pxr/usd/ar/testenv/testArDefaultResolver.py @@ -320,6 +320,18 @@ def test_ResolverContext(self): self.assertNotEqual(emptyContext, context) + def test_ResolverContextHash(self): + self.assertEqual( + hash(Ar.DefaultResolverContext()), + hash(Ar.DefaultResolverContext()) + ) + + paths = ["/path1", "/path2", "/path3", "/path4"] + self.assertEqual( + hash(Ar.DefaultResolverContext(paths)), + hash(Ar.DefaultResolverContext(paths)) + ) + def test_ResolveForNewAsset(self): resolver = Ar.GetResolver()