mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Tidied coding/decoding to be a bit more efficient.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3120 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2c35e21378
commit
89f459748a
2 changed files with 37 additions and 31 deletions
|
@ -185,9 +185,12 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
|||
- (void) encodeWithCoder: aCoder
|
||||
{
|
||||
[aCoder encodeValueOfObjCType:@encode(unsigned) at:&_count];
|
||||
[aCoder encodeArrayOfObjCType:@encode(unsigned char)
|
||||
count:_count
|
||||
at:_contents_chars];
|
||||
if (_count > 0)
|
||||
{
|
||||
[aCoder encodeArrayOfObjCType:@encode(unsigned char)
|
||||
count:_count
|
||||
at:_contents_chars];
|
||||
}
|
||||
}
|
||||
|
||||
- initWithCoder: aCoder
|
||||
|
@ -887,9 +890,12 @@ stringDecrementCountAndFillHoleAt(NSGMutableCStringStruct *self,
|
|||
[aCoder decodeValueOfObjCType:@encode(unsigned) at:&cap];
|
||||
[self initWithCapacity:cap];
|
||||
_count = cap;
|
||||
[aCoder decodeArrayOfObjCType:@encode(unsigned char)
|
||||
count:_count
|
||||
at:_contents_chars];
|
||||
if (_count > 0)
|
||||
{
|
||||
[aCoder decodeArrayOfObjCType: @encode(unsigned char)
|
||||
count: _count
|
||||
at: _contents_chars];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue