aboutsummaryrefslogtreecommitdiffhomepage
path: root/SplitSource.php
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2025-08-18 20:03:42 +0300
committerlevlam <levlam@telegram.org>2025-08-18 20:03:42 +0300
commit26970735b03ae428a6f10db881284c7e25e395d9 (patch)
tree8e6650d482a7bbc402fb7038429fd93f6fc115ec /SplitSource.php
parentd05213709cc36fa7ad8d524f91da5feb76e5d43f (diff)
Simplify SplitSource.php.
Diffstat (limited to 'SplitSource.php')
-rw-r--r--SplitSource.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/SplitSource.php b/SplitSource.php
index a300ce99d..cdfec3321 100644
--- a/SplitSource.php
+++ b/SplitSource.php
@@ -30,19 +30,11 @@ function split_file($file, $chunks, $undo) {
$new_files[] = "$file$n.cpp";
}
- $is_generated = (strpos($file, 'td/generate/') === 0);
-
- $cmake_file = $is_generated ? 'td/generate/CMakeLists.txt' : 'CMakeLists.txt';
+ $cmake_file = 'CMakeLists.txt';
$cmake = file_get_contents($cmake_file);
$cmake_cpp_name = $cpp_name;
$cmake_new_files = $new_files;
- if ($is_generated) {
- foreach ($cmake_new_files as &$file_ref) {
- $file_ref = str_replace('td/generate/auto/td', '${TD_AUTO_INCLUDE_DIR}', $file_ref);
- }
- $cmake_cpp_name = str_replace('td/generate/auto/td', '${TD_AUTO_INCLUDE_DIR}', $cmake_cpp_name);
- }
if ($undo) {
foreach ($new_files as $file) {
@@ -72,7 +64,7 @@ function split_file($file, $chunks, $undo) {
$lines = file($cpp_name);
$depth = 0;
- $target_depth = 1 + $is_generated;
+ $target_depth = 1;
$is_static = false;
$in_define = false;
$in_comment = false;
@@ -171,16 +163,12 @@ function split_file($file, $chunks, $undo) {
'(?<name>complete_pending_preauthentication_requests)|'.
'(?<name>get_message_history_slice)|'.
'(Up|Down)load(?!ManagerCallback)[a-zA-Z]+C(?<name>allback)|(up|down)load_[a-z_]*_c(?<name>allback)_|'.
- '(?<name>lazy_to_json)|'.
'(?<name>LogEvent)[^sA]|'.
'(?<name>parse)[(]|'.
'(?<name>store)[(]/', $f, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$name = $match['name'];
if ($name === 'parse' || $name === 'store') {
- if ($is_generated) {
- continue;
- }
$name = 'LogEvent';
}
$deps[$name][] = $i;