Skip to content

Commit 6b1e401

Browse files
committed
Revert packed array related changes
1 parent ebda1e8 commit 6b1e401

File tree

1 file changed

+18
-44
lines changed

1 file changed

+18
-44
lines changed

ext/intl/dateformat/dateformat_format_object.cpp

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -101,54 +101,28 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
101101
}
102102

103103
idx = 0;
104-
if (HT_IS_PACKED(ht)) {
105-
while (idx < ht->nNumUsed) {
106-
z = &ht->arPacked[idx];
107-
if (Z_TYPE_P(z) != IS_UNDEF) {
108-
break;
109-
}
110-
idx++;
104+
while (idx < ht->nNumUsed) {
105+
z = &ht->arData[idx].val;
106+
if (Z_TYPE_P(z) != IS_UNDEF) {
107+
break;
111108
}
112-
if (idx >= ht->nNumUsed || !valid_format(z)) {
113-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
114-
"datefmt_format_object: bad format; the date format (first "
115-
"element of the array) is not valid", 0);
116-
RETURN_FALSE;
117-
}
118-
dateStyle = (DateFormat::EStyle)Z_LVAL_P(z);
119-
120109
idx++;
121-
while (idx < ht->nNumUsed) {
122-
z = &ht->arPacked[idx];
123-
if (Z_TYPE_P(z) != IS_UNDEF) {
124-
break;
125-
}
126-
idx++;
127-
}
128-
} else {
129-
while (idx < ht->nNumUsed) {
130-
z = &ht->arData[idx].val;
131-
if (Z_TYPE_P(z) != IS_UNDEF) {
132-
break;
133-
}
134-
idx++;
135-
}
136-
if (idx >= ht->nNumUsed || !valid_format(z)) {
137-
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
138-
"datefmt_format_object: bad format; the date format (first "
139-
"element of the array) is not valid", 0);
140-
RETURN_FALSE;
141-
}
142-
dateStyle = (DateFormat::EStyle)Z_LVAL_P(z);
110+
}
111+
if (idx >= ht->nNumUsed || !valid_format(z)) {
112+
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
113+
"datefmt_format_object: bad format; the date format (first "
114+
"element of the array) is not valid", 0);
115+
RETURN_FALSE;
116+
}
117+
dateStyle = (DateFormat::EStyle)Z_LVAL_P(z);
143118

144-
idx++;
145-
while (idx < ht->nNumUsed) {
146-
z = &ht->arData[idx].val;
147-
if (Z_TYPE_P(z) != IS_UNDEF) {
148-
break;
149-
}
150-
idx++;
119+
idx++;
120+
while (idx < ht->nNumUsed) {
121+
z = &ht->arData[idx].val;
122+
if (Z_TYPE_P(z) != IS_UNDEF) {
123+
break;
151124
}
125+
idx++;
152126
}
153127
if (idx >= ht->nNumUsed || !valid_format(z)) {
154128
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,

0 commit comments

Comments
 (0)