RFR: Make instantiating forges from known hosts faster

Erik Helin ehelin at openjdk.java.net
Wed Dec 4 15:45:47 UTC 2019


Hi all,

please review this pull request that speeds things up a little when calling `Forge.from`. If the hostname of the provided URI exactly matches a known host for exactly one `ForgeFactory`, then I argue that it is safe to create a `Forge` from that factory and return it without calling `isValid()` first. In other words, I would be very surprised if we ever encounter an issue with returning a `GitHubForge` instance for URIs with a hostname of `github.com` (and vice-versa, a `GitLabForge` instance for URIs with a hostname of `gitlab.com`).

Thanks,
Erik

## Testing
- [x] `make test` on Linux x64

-------------

Commits:
 - 82a6626c: Make instatiating forges from known hosts faster

Changes: https://git.openjdk.java.net/skara/pull/293/files
 Webrev: https://webrevs.openjdk.java.net/skara/293/webrev.00
  Stats: 43 lines in 5 files changed: 39 ins; 0 del; 4 mod
  Patch: https://git.openjdk.java.net/skara/pull/293.diff
  Fetch: git fetch https://git.openjdk.java.net/skara pull/293/head:pull/293

PR: https://git.openjdk.java.net/skara/pull/293


More information about the skara-dev mailing list