mirror of https://github.com/JustKato/FreePad.git
* Optimization ( Thanks Tecchie088 )
This commit is contained in:
parent
97102b98b3
commit
685c6ae15f
|
@ -233,8 +233,6 @@ func WritePost(p Post) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Actually close the file
|
||||
defer f.Close()
|
||||
|
||||
// Write the contnets
|
||||
_, err = f.WriteString(p.Content)
|
||||
|
@ -242,11 +240,7 @@ func WritePost(p Post) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if err := f.Close(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return f.Close()
|
||||
}
|
||||
|
||||
// Cleanup all of the older posts based on the environment settings
|
||||
|
|
Loading…
Reference in New Issue