Skip to content

Commit

Permalink
remove strip() per #49
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcvetta committed Oct 11, 2014
1 parent b746707 commit 3de6906
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
14 changes: 2 additions & 12 deletions cypher.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package neoism
import (
"encoding/json"
"errors"
"strings"
)

// A CypherQuery is a statement in the Cypher query language, with optional
Expand Down Expand Up @@ -66,7 +65,7 @@ type cypherResult struct {
func (db *Database) Cypher(q *CypherQuery) error {
result := cypherResult{}
payload := cypherRequest{
Query: strip(q.Statement),
Query: q.Statement,
Parameters: q.Parameters,
}
ne := NeoError{}
Expand Down Expand Up @@ -115,7 +114,7 @@ func (db *Database) CypherBatch(qs []*CypherQuery) error {
To: "/cypher",
Id: i,
Body: cypherRequest{
Query: strip(q.Statement),
Query: q.Statement,
Parameters: q.Parameters,
},
}
Expand Down Expand Up @@ -144,12 +143,3 @@ func (db *Database) CypherBatch(qs []*CypherQuery) error {
}
return nil
}

// strip removes tabs and newlines from a string. Used to prepare Cypher
// statements for transmission to server. Not required by server, but makes
// statements more readable for verbose logging.
func strip(s string) string {
s = strings.Replace(s, "\t", "", -1)
s = strings.Replace(s, "\n", " ", -1)
return s
}
3 changes: 0 additions & 3 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ func (tr *txResponse) unmarshal(qs []*CypherQuery) error {
// inside the transaction.
func (db *Database) Begin(qs []*CypherQuery) (*Tx, error) {
payload := txRequest{Statements: qs}
for _, cq := range payload.Statements {
cq.Statement = strip(cq.Statement)
}
result := txResponse{}
ne := NeoError{}
resp, err := db.Session.Post(db.HrefTransaction, payload, &result, &ne)
Expand Down

0 comments on commit 3de6906

Please sign in to comment.