Skip to content

Commit

Permalink
Avoid DataLoaderRegistry.getKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielThomas committed Aug 28, 2023
1 parent 329ca02 commit 923688d
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,11 @@ open class DgsDataLoaderRegistry : DataLoaderRegistry() {
* @return a data loader or null if its not present
</V></K> */
override fun <K, V> getDataLoader(key: String): DataLoader<K, V>? {
if (dataLoaderRegistry.keys.contains(key)) {
return dataLoaderRegistry.getDataLoader(key)
} else if (scheduledDataLoaderRegistries.contains(key)) {
return scheduledDataLoaderRegistries[key]?.getDataLoader(key)
}
return null
return dataLoaderRegistry.getDataLoader(key) ?: scheduledDataLoaderRegistries[key]?.getDataLoader(key)
}

override fun getKeys(): Set<String> {
return HashSet(scheduledDataLoaderRegistries.keys).plus(dataLoaderRegistry.keys)
return scheduledDataLoaderRegistries.keys.plus(dataLoaderRegistry.keys)
}

/**
Expand Down

0 comments on commit 923688d

Please sign in to comment.