mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-4989: Fix run time exception when using Swift TCompactProtocol
Client: Swift Patch: David Furey This closes #1908 Sort TStruct members by key before generating class properties so that Swift Thrift lib can use delta encoding for CompactProtocol.
This commit is contained in:
parent
9ea48f362a
commit
b1d4b3afcc
@ -697,7 +697,9 @@ void t_swift_generator::generate_swift_struct(ostream& out,
|
|||||||
}
|
}
|
||||||
|
|
||||||
block_open(out);
|
block_open(out);
|
||||||
for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
|
vector<t_field*> sorted = members;
|
||||||
|
sort(sorted.begin(), sorted.end(), [](t_field *a, t_field *b) { return (a->get_key() < b->get_key()); } );
|
||||||
|
for (m_iter = sorted.begin(); m_iter != sorted.end(); ++m_iter) {
|
||||||
out << endl;
|
out << endl;
|
||||||
// TODO: Defaults
|
// TODO: Defaults
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user