feat: new APIs of merge, diff and update#38
Draft
xiegx94 wants to merge 2 commits intobytedance:masterfrom
Draft
feat: new APIs of merge, diff and update#38xiegx94 wants to merge 2 commits intobytedance:masterfrom
xiegx94 wants to merge 2 commits intobytedance:masterfrom
Conversation
liuq19
reviewed
Dec 20, 2022
| using alloc_type = | ||
| typename NodeTraits<NodeType>::alloc_type; ///< Dervied class allocator | ||
| ///< type. | ||
| using Allocator = alloc_type; |
Collaborator
There was a problem hiding this comment.
allocator 名字和 alloc_type 重复
liuq19
reviewed
Dec 20, 2022
include/sonic/dom/genericnode.h
Outdated
| typename std::enable_if<is_base_of_template<T, GenericNode>::value && | ||
| is_base_of_template<P, GenericNode>::value, | ||
| bool>::type = false> | ||
| static inline void Merge(T& original, const P& patch, Allocator& alloc) { |
Collaborator
There was a problem hiding this comment.
可能做出 genericnode的成员函数会比较好?
Collaborator
Author
There was a problem hiding this comment.
GenericNode里提供了 MergePatch 的方法,实现了 Merge 的语义
liuq19
reviewed
Dec 20, 2022
include/sonic/dom/genericnode.h
Outdated
| typename std::enable_if<is_base_of_template<T, GenericNode>::value && | ||
| is_base_of_template<S, GenericNode>::value, | ||
| bool>::type = false> | ||
| static inline void Update(T& original, const S& src, Allocator& alloc) { |
Collaborator
Author
There was a problem hiding this comment.
没有必要吧,两者逻辑差不多,只有些微区别。额外添加一个函数反而维护起来很麻烦。
Collaborator
Author
|
Remove diff API. |
liuq19
reviewed
Mar 8, 2023
14ce2e2 to
6e4a0ed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main Changes