mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95074 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bd46725476
commit
fcad6bdc17
@ -156,28 +156,25 @@ private:
|
|||||||
// Current key overlaps with the inserted key.
|
// Current key overlaps with the inserted key.
|
||||||
// Remove the current key.
|
// Remove the current key.
|
||||||
Changed = true;
|
Changed = true;
|
||||||
TreeTy *OldNode = T;
|
data_type_ref OldData = ImutInfo::DataOfValue(Value(T));
|
||||||
T = Remove_internal(CurrentK, T);
|
T = Remove_internal(CurrentK, T);
|
||||||
// Add back the unoverlapped part of the current key.
|
// Add back the unoverlapped part of the current key.
|
||||||
if (CurrentK.getStart() < K.getStart()) {
|
if (CurrentK.getStart() < K.getStart()) {
|
||||||
if (CurrentK.getEnd() <= K.getEnd()) {
|
if (CurrentK.getEnd() <= K.getEnd()) {
|
||||||
Interval NewK(CurrentK.getStart(), K.getStart()-1);
|
Interval NewK(CurrentK.getStart(), K.getStart()-1);
|
||||||
return Add_internal(std::make_pair<key_type, data_type>(NewK,
|
return Add_internal(std::make_pair(NewK, OldData), T);
|
||||||
ImutInfo::DataOfValue(Value(OldNode))), T);
|
|
||||||
} else {
|
} else {
|
||||||
Interval NewK1(CurrentK.getStart(), K.getStart()-1);
|
Interval NewK1(CurrentK.getStart(), K.getStart()-1);
|
||||||
T = Add_internal(std::make_pair<key_type, data_type>(NewK1,
|
T = Add_internal(std::make_pair(NewK1, OldData), T);
|
||||||
ImutInfo::DataOfValue(Value(OldNode))), T);
|
|
||||||
|
|
||||||
Interval NewK2(K.getEnd()+1, CurrentK.getEnd());
|
Interval NewK2(K.getEnd()+1, CurrentK.getEnd());
|
||||||
return Add_internal(std::make_pair<key_type, data_type>(NewK2,
|
return Add_internal(std::make_pair(NewK2, OldData), T);
|
||||||
ImutInfo::DataOfValue(Value(OldNode))), T);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (CurrentK.getEnd() > K.getEnd()) {
|
if (CurrentK.getEnd() > K.getEnd()) {
|
||||||
Interval NewK(K.getEnd()+1, CurrentK.getEnd());
|
Interval NewK(K.getEnd()+1, CurrentK.getEnd());
|
||||||
return Add_internal(std::make_pair<key_type, data_type>(NewK,
|
return Add_internal(std::make_pair(NewK, OldData), T);
|
||||||
ImutInfo::DataOfValue(Value(OldNode))), T);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user