optimizations
This commit is contained in:
@@ -23,6 +23,23 @@ func (e Error) Copy() Object {
|
||||
return Error{Message: e.Message}
|
||||
}
|
||||
|
||||
func (e Error) Compare(other Object) int {
|
||||
if obj, ok := other.(Error); ok {
|
||||
if e.Message > obj.Message {
|
||||
return 1
|
||||
}
|
||||
if e.Message == obj.Message {
|
||||
return 0
|
||||
}
|
||||
return -1
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
func (e Error) Error() string {
|
||||
return e.Message
|
||||
}
|
||||
|
||||
func (e Error) String() string {
|
||||
return e.Message
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user