equal
deleted
inserted
replaced
101 m_data = 0; |
101 m_data = 0; |
102 return; |
102 return; |
103 } |
103 } |
104 |
104 |
105 m_data = newUCharVector(m_length); |
105 m_data = newUCharVector(m_length); |
106 if ( !m_data ) { |
|
107 m_length = 0; |
|
108 return; |
|
109 } |
|
110 int i = m_length; |
106 int i = m_length; |
111 UChar* ptr = m_data; |
107 UChar* ptr = m_data; |
112 while (i--) { |
108 while (i--) { |
113 unsigned char c = *str++; |
109 unsigned char c = *str++; |
114 *ptr++ = c; |
110 *ptr++ = c; |
125 m_data = 0; |
121 m_data = 0; |
126 return; |
122 return; |
127 } |
123 } |
128 |
124 |
129 m_data = newUCharVector(len); |
125 m_data = newUCharVector(len); |
130 if ( !m_data ) { |
126 memcpy(m_data, str, len * sizeof(UChar)); |
131 m_length = 0; |
|
132 return; |
|
133 } |
|
134 memcpy(m_data, str, len * sizeof(UChar)); |
|
135 } |
127 } |
136 |
128 |
137 StringImpl::~StringImpl() |
129 StringImpl::~StringImpl() |
138 { |
130 { |
139 if (m_inTable) |
131 if (m_inTable) |