googleapis / disco-to-proto3-converter

Apache License 2.0
11 stars 11 forks source link

consolidate code: parseMethods + ParseResources #123

Open vchudnov-g opened 6 months ago

vchudnov-g commented 6 months ago

parseResources and parseMethods appear to have essentially identical code that only differs in what is returned. For clarity and to reduce duplication, consider combining the two.

One idea is to pass in a lambda to a common function that can be used to call resources.put or methods.addAll; the latter can be the default if no lambda is provided, since it is the recursive case.