File tree Expand file tree Collapse file tree 2 files changed +10
-20
lines changed
Expand file tree Collapse file tree 2 files changed +10
-20
lines changed Original file line number Diff line number Diff line change @@ -1368,8 +1368,6 @@ void ConvString (
13681368** otherwise. If <obj> is a string it changes its representation to the
13691369** string representation.
13701370*/
1371- Obj IsStringConvFilt ;
1372-
13731371Int IsStringConv (
13741372 Obj obj )
13751373{
@@ -1388,17 +1386,6 @@ Int IsStringConv (
13881386}
13891387
13901388
1391- /****************************************************************************
1392- **
1393- *F MakeImmutableString( <str> ) make a string immutable in place
1394- **
1395- */
1396-
1397- void MakeImmutableString ( Obj str )
1398- {
1399- RetypeBag (str , IMMUTABLE_TNUM (TNUM_OBJ (str )));
1400- }
1401-
14021389Obj ConvImmString (Obj str )
14031390{
14041391 Obj result ;
Original file line number Diff line number Diff line change @@ -321,13 +321,15 @@ extern Int IsStringConv (
321321 memcpy( CHARS_STRING(string), (cstr), tmp_len ); \
322322 } while ( 0 );
323323
324+
324325/****************************************************************************
325326**
326- *F MakeImmutableString( <str> ) make a string immutable in place
327- **
327+ *F MakeImmutableString( <str> ) . . . . . . make a string immutable in place
328328*/
329-
330- void MakeImmutableString (Obj str );
329+ static inline void MakeImmutableString (Obj str )
330+ {
331+ RetypeBag (str , IMMUTABLE_TNUM (TNUM_OBJ (str )));
332+ }
331333
332334
333335// Functions to create mutable and immutable GAP strings from C strings.
@@ -336,15 +338,16 @@ void MakeImmutableString(Obj str);
336338
337339static inline Obj MakeString (const Char * cstr )
338340{
339- Obj result ;
340- C_NEW_STRING (result , strlen (cstr ), cstr );
341+ size_t len = strlen (cstr );
342+ Obj result = NEW_STRING (len );
343+ memcpy (CHARS_STRING (result ), cstr , len );
341344 return result ;
342345}
343346
344347static inline Obj MakeImmString (const Char * cstr )
345348{
346349 Obj result = MakeString (cstr );
347- RetypeBag (result , IMMUTABLE_TNUM ( T_STRING ) );
350+ MakeImmutableString (result );
348351 return result ;
349352}
350353
You can’t perform that action at this time.
0 commit comments