mirror of
https://github.com/JustKato/FreePad.git
synced 2026-04-05 19:38:47 +03:00
* Optimization ( Thanks Tecchie088 )
This commit is contained in:
@@ -233,8 +233,6 @@ func WritePost(p Post) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Actually close the file
|
|
||||||
defer f.Close()
|
|
||||||
|
|
||||||
// Write the contnets
|
// Write the contnets
|
||||||
_, err = f.WriteString(p.Content)
|
_, err = f.WriteString(p.Content)
|
||||||
@@ -242,11 +240,7 @@ func WritePost(p Post) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := f.Close(); err != nil {
|
return f.Close()
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup all of the older posts based on the environment settings
|
// Cleanup all of the older posts based on the environment settings
|
||||||
|
|||||||
Reference in New Issue
Block a user