Skip to content

Commit 4eb6d11

Browse files
committed
container traits: remove normalisation
These were added before the big refactoring around templates. The space issues have been solved since then, and these extra normalisations are not necessary anymore I just added them at one point to be able to fix some tests and get a better visibility
1 parent c98759f commit 4eb6d11

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/pygccxml/declarations/container_traits.py

+11-14
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ def erase_allocator(self, cls_name, default_allocator='std::allocator'):
110110
container=c_name,
111111
value_type=value_type,
112112
allocator=default_allocator)
113-
if self.normalize(cls_name) == \
114-
self.normalize(tmpl):
113+
if cls_name == tmpl:
115114
return templates.join(
116115
c_name, [self.erase_recursive(value_type)])
117116

@@ -122,8 +121,8 @@ def erase_container(self, cls_name, default_container_name='std::deque'):
122121
return
123122
value_type = c_args[0]
124123
dc_no_defaults = self.erase_recursive(c_args[1])
125-
if self.normalize(dc_no_defaults) == self.normalize(
126-
templates.join(default_container_name, [value_type])):
124+
if dc_no_defaults == \
125+
templates.join(default_container_name, [value_type]):
127126
return templates.join(
128127
c_name, [self.erase_recursive(value_type)])
129128

@@ -137,12 +136,12 @@ def erase_container_compare(
137136
if len(c_args) != 3:
138137
return
139138
dc_no_defaults = self.erase_recursive(c_args[1])
140-
if self.normalize(dc_no_defaults) != self.normalize(
141-
templates.join(default_container_name, [c_args[0]])):
139+
if dc_no_defaults != \
140+
templates.join(default_container_name, [c_args[0]]):
142141
return
143142
dcomp_no_defaults = self.erase_recursive(c_args[2])
144-
if self.normalize(dcomp_no_defaults) != self.normalize(
145-
templates.join(default_compare, [c_args[0]])):
143+
if dcomp_no_defaults != \
144+
templates.join(default_compare, [c_args[0]]):
146145
return
147146
value_type = self.erase_recursive(c_args[0])
148147
return templates.join(c_name, [value_type])
@@ -165,8 +164,7 @@ def erase_compare_allocator(
165164
value_type=value_type,
166165
compare=default_compare,
167166
allocator=default_allocator)
168-
if self.normalize(cls_name) == \
169-
self.normalize(tmpl):
167+
if cls_name == tmpl:
170168
return templates.join(
171169
c_name, [self.erase_recursive(value_type)])
172170

@@ -198,7 +196,7 @@ def erase_map_compare_allocator(
198196
mapped_type=mapped_type,
199197
compare=default_compare,
200198
allocator=default_allocator)
201-
if self.normalize(cls_name) == self.normalize(tmpl):
199+
if cls_name == tmpl:
202200
return templates.join(
203201
c_name,
204202
[self.erase_recursive(key_type),
@@ -237,8 +235,7 @@ def erase_hash_allocator(self, cls_name):
237235
less=default_less,
238236
equal_to=default_equal_to,
239237
allocator=default_allocator)
240-
if self.normalize(cls_name) == \
241-
self.normalize(inst):
238+
if cls_name == inst:
242239
return templates.join(
243240
c_name, [self.erase_recursive(value_type)])
244241

@@ -316,7 +313,7 @@ def erase_hashmap_compare_allocator(self, cls_name):
316313
equal_to=default_equal_to,
317314
allocator=default_allocator)
318315

319-
if self.normalize(cls_name) == self.normalize(inst):
316+
if cls_name == inst:
320317
return templates.join(
321318
c_name,
322319
[self.erase_recursive(key_type),

0 commit comments

Comments
 (0)