<commit_before>package raft

import (
	"log"

	"code.google.com/p/go.net/context"
)

func applyToStore(ents []Entry)   {}
func sendMessages(msgs []Message) {}
func saveStateToDisk(st State)    {}
func saveToDisk(ents []Entry)     {}

func Example_Node() {
	n := Start(context.Background(), 0)

	// stuff to n happens in other goroutines

	// the last known state
	var prev *State
	for {
		// ReadState blocks until there is new state ready.
		st, ents, cents, msgs, err := n.ReadState(context.Background())
		if err != nil {
			log.Fatal(err)
		}

		curr := &st
		if !prev.Equal(st) {
			saveStateToDisk(st)
			prev = curr
		}

		saveToDisk(ents)
		applyToStore(cents)
		sendMessages(msgs)
	}
}
<commit_msg>raft: remove old pointer<commit_after>package raft

import (
	"log"

	"code.google.com/p/go.net/context"
)

func applyToStore(ents []Entry)   {}
func sendMessages(msgs []Message) {}
func saveStateToDisk(st State)    {}
func saveToDisk(ents []Entry)     {}

func Example_Node() {
	n := Start(context.Background(), 0)

	// stuff to n happens in other goroutines

	// the last known state
	var prev State
	for {
		// ReadState blocks until there is new state ready.
		st, ents, cents, msgs, err := n.ReadState(context.Background())
		if err != nil {
			log.Fatal(err)
		}

		if !prev.Equal(st) {
			saveStateToDisk(st)
			prev = st
		}

		saveToDisk(ents)
		go applyToStore(cents)
		sendMessages(msgs)
	}
}

{'fraction_non_alphanumeric': 0.1339475549255847, 'fraction_numerical': 0.001417434443656981, 'mean_word_length': 3.440251572327044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5485518', 'n_tokens_mistral': 554, 'n_tokens_neox': 505, 'n_words': 132}