MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / merge_methods

Function merge_methods

editor/doc/doc_tools.cpp:185–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185static void merge_methods(Vector<DocData::MethodDoc> &p_to, const Vector<DocData::MethodDoc> &p_from) {
186 // Get data from `p_to`, to avoid mutation checks. Searching will be done in the sorted `p_to` from the (potentially) unsorted `p_from`.
187 DocData::MethodDoc *to_ptrw = p_to.ptrw();
188 int64_t to_size = p_to.size();
189
190 for (const DocData::MethodDoc &from : p_from) {
191 int64_t found = p_to.span().bisect<MethodCompare>(from, true);
192
193 if (found >= to_size) {
194 continue;
195 }
196
197 DocData::MethodDoc &to = to_ptrw[found];
198
199 // Check found entry on name.
200 if (to.name == from.name) {
201 to.description = from.description;
202 to.is_deprecated = from.is_deprecated;
203 to.deprecated_message = from.deprecated_message;
204 to.is_experimental = from.is_experimental;
205 to.experimental_message = from.experimental_message;
206 to.keywords = from.keywords;
207 }
208 }
209}
210
211static void merge_constants(Vector<DocData::ConstantDoc> &p_to, const Vector<DocData::ConstantDoc> &p_from) {
212 // Get data from `p_from`, to avoid mutation checks. Searching will be done in the sorted `p_from` from the unsorted `p_to`.

Callers 1

merge_fromMethod · 0.85

Calls 3

sizeMethod · 0.65
ptrwMethod · 0.45
spanMethod · 0.45

Tested by

no test coverage detected