Skip to content

Conversation

@erwanor
Copy link

@erwanor erwanor commented Aug 6, 2016

No description provided.

host_test.go Outdated
scanner := bufio.NewScanner(r)

// Consume the initial buffer
scanner.Scan()
Copy link
Owner

@shazow shazow Aug 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-0.5 on this change, not worth it unless we're doing this for large N (like >5). More clear to avoid the extra indirection otherwise.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are only one case where N>5 (:> N=8) - do you think it is worth keeping the function then? The eight calls to scanner.Scan() aren't "pretty" but at least there is one way to do it (decrease the cognitive cost of figuring out what is going on). Wdyt?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah fair enough, let's hang onto it for now.

@shazow
Copy link
Owner

shazow commented Aug 12, 2016

Make sure it builds. :) I suggest using go integration with your editor, it'll do it automagically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants