Some performance tweaks to the wasm code

Removed two fmt.Sprintf() calls and a fmt.Printf() call.  The Printf()
was for debugging and isn't needed anymore.  Sprintf() apparently
isn't all that performant.
This commit is contained in:
Zorchenhimer 2019-03-14 10:10:11 -04:00
parent 0effbf49b5
commit 653ff6fc9c
2 changed files with 1 additions and 3 deletions

View File

@ -180,7 +180,6 @@ func (c ClientData) HTML() string {
// TODO: Read this HTML from a template somewhere
func (dc DataMessage) HTML() string {
fmt.Printf("message type: %d\n", dc.Type)
switch dc.Type {
case MsgAction:
return `<div style="color:` + dc.Color + `"><span class="name">` + dc.From +
@ -293,7 +292,7 @@ func DecodeData(rawjson string) (DataInterface, error) {
return nil, fmt.Errorf("Error decoding token: %s", err)
}
if fmt.Sprintf("%s", key) == "Type" {
if key.(string) == "Type" {
value, err := decoder.Token()
if err != nil {
return nil, fmt.Errorf("Error decoding data value: %q", err)

View File

@ -14,7 +14,6 @@ func recieve(v []js.Value) {
return
}
fmt.Printf("Received: %s\n", v[0])
data, err := common.DecodeData(v[0].String())
if err != nil {
fmt.Printf("Error decoding data: %s\n", err)