WIP: Refactor entire hosts reading and writing code #1
No reviewers
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: alfred/HostPersister#1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "melon/HostPersister:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I started refactoring the host reading and writing code. This consists mostly of improvements in readability and performance.
@melon You have some stuff todo.
@ -0,0 +9,4 @@
r io.Reader
over []byte
mark byte
hit bool
Whats this used for (hit)?
It's only checked in one place.
@ -0,0 +58,4 @@
func ParseEntry(line io.Reader) (entry Entry, err error) {
cr := NewCommentReader(line, '#')
sc := bufio.NewScanner(cr)
Support a larger buffer size if needed (Extra command line arg and/or env variable).
https://stackoverflow.com/questions/39859222/golang-how-to-overcome-scan-buffer-limit-from-bufio
@ -0,0 +28,4 @@
}
defer theFile.Close()
sc := bufio.NewScanner(theFile)
Support a larger buffer size if needed (Extra command line arg and/or env variable).
https://stackoverflow.com/questions/39859222/golang-how-to-overcome-scan-buffer-limit-from-bufio
Refactor entire hosts reading and writing codeto WIP: Refactor entire hosts reading and writing codeCheckout
From your project repository, check out a new branch and test the changes.