Don't cache the description of exceptions.

This was pretty pointless, as it's usually only used once.
This commit is contained in:
Jonathan Schleifer 2013-02-14 00:18:20 +01:00
parent 4a016c271f
commit 869b122a15

View file

@ -65,17 +65,6 @@
[super dealloc]; [super dealloc];
} }
- (OFString*)description
{
if (_description != nil)
return _description;
_description = [[OFString alloc] initWithFormat:
@"An exception occurred in class %@!", _inClass];
return _description;
}
- (XMPPConnection*)connection - (XMPPConnection*)connection
{ {
return _connection; return _connection;
@ -132,13 +121,9 @@
- (OFString*)description - (OFString*)description
{ {
if (_description != nil) return [OFString stringWithFormat:
return _description; @"Got stream error in class %@: %@. Reason: %@!", [self inClass],
condition, reason];
_description = [[OFString alloc] initWithFormat:
@"Got stream error: %@. Reason: %@!", condition, reason];
return _description;
} }
- (OFString*)condition - (OFString*)condition
@ -202,14 +187,9 @@
- (OFString*)description - (OFString*)description
{ {
if (_description != nil) return [OFString stringWithFormat:
return _description; @"Stringprep with profile %@ failed in class %@ on string '%@'!",
profile, [self inClass], string];
_description = [[OFString alloc] initWithFormat:
@"Stringprep with profile %@ failed on string '%@'!",
profile, string];
return _description;
} }
- (OFString*)profile - (OFString*)profile
@ -273,13 +253,9 @@
- (OFString*)description - (OFString*)description
{ {
if (_description != nil) return [OFString stringWithFormat:
return _description; @"IDNA operation %@ failed in class %@ on string '%@'!", operation,
[self inClass], string];
_description = [[OFString alloc] initWithFormat:
@"IDNA operation %@ failed on string '%@'!", operation, string];
return _description;
} }
- (OFString*)operation - (OFString*)operation
@ -338,13 +314,9 @@
- (OFString*)description - (OFString*)description
{ {
if (_description != nil) return [OFString stringWithFormat:
return _description; @"Authentication failed in class %@. Reason: %@!", [self inClass],
reason];
_description = [[OFString alloc] initWithFormat:
@"Authentication failed. Reason: %@!", reason];
return _description;
} }
- (OFString*)reason - (OFString*)reason