Skip to content

Commit

Permalink
Merge pull request #66 from etcd-team/wal_refactor
Browse files Browse the repository at this point in the history
wal: move record method to record.go
  • Loading branch information
xiang90 committed Aug 24, 2014
2 parents 48c9d65 + 165e7da commit 9d7298b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 11 additions & 0 deletions wal/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package wal

import (
"encoding/binary"
"io"
)

Expand Down Expand Up @@ -45,3 +46,13 @@ func readRecord(r io.Reader, rec *Record) error {
}
return rec.Unmarshal(d)
}

func writeInt64(w io.Writer, n int64) error {
return binary.Write(w, binary.LittleEndian, n)
}

func readInt64(r io.Reader) (int64, error) {
var n int64
err := binary.Read(r, binary.LittleEndian, &n)
return n, err
}
11 changes: 0 additions & 11 deletions wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package wal
import (
"bufio"
"bytes"
"encoding/binary"
"fmt"
"io"
"log"
Expand Down Expand Up @@ -372,16 +371,6 @@ func parseWalName(str string) (seq, index int64, err error) {
return
}

func writeInt64(w io.Writer, n int64) error {
return binary.Write(w, binary.LittleEndian, n)
}

func readInt64(r io.Reader) (int64, error) {
var n int64
err := binary.Read(r, binary.LittleEndian, &n)
return n, err
}

func max(a, b int64) int64 {
if a > b {
return a
Expand Down

0 comments on commit 9d7298b

Please sign in to comment.