jfversluis / BeenPwned.Api

.NET Wrapper library for the haveibeenpwned.com API
https://haveibeenpwned.com
MIT License
8 stars 2 forks source link

Removes unnecessary awaits. #9

Closed CayasSoftware closed 7 years ago

CayasSoftware commented 7 years ago

Because nothing is done with the result, the task should be returned directly.

jfversluis commented 7 years ago

Fair enough, doesn't seem particularly useful to await those calls instead of just passing them on.

Just out of curiosity; does it have any implications doing it one way or the other?

CayasSoftware commented 7 years ago

await is used to continue the execution but in this case there is nothing to continue with. It reduces the overhead that the compiler needs to create.

Basically you can think of it like you save one task and the need to create one more state-machine.