@@ -330,67 +330,6 @@ void ScriptEditorBase::_bind_methods() {
330330 ADD_SIGNAL (MethodInfo (" go_to_method" , PropertyInfo (Variant::OBJECT, " script" ), PropertyInfo (Variant::STRING, " method" )));
331331}
332332
333- class EditorScriptCodeCompletionCache : public ScriptCodeCompletionCache {
334- struct Cache {
335- uint64_t time_loaded = 0 ;
336- Ref<Resource> cache;
337- };
338-
339- HashMap<String, Cache> cached;
340-
341- public:
342- uint64_t max_time_cache = 5 * 60 * 1000 ; // minutes, five
343- uint32_t max_cache_size = 128 ;
344-
345- void cleanup () {
346- List<String> to_clean;
347-
348- HashMap<String, Cache>::Iterator I = cached.begin ();
349- while (I) {
350- if ((OS::get_singleton ()->get_ticks_msec () - I->value .time_loaded ) > max_time_cache) {
351- to_clean.push_back (I->key );
352- }
353- ++I;
354- }
355-
356- while (to_clean.front ()) {
357- cached.erase (to_clean.front ()->get ());
358- to_clean.pop_front ();
359- }
360- }
361-
362- virtual Ref<Resource> get_cached_resource (const String &p_path) {
363- HashMap<String, Cache>::Iterator E = cached.find (p_path);
364- if (!E) {
365- Cache c;
366- c.cache = ResourceLoader::load (p_path);
367- E = cached.insert (p_path, c);
368- }
369-
370- E->value .time_loaded = OS::get_singleton ()->get_ticks_msec ();
371-
372- if (cached.size () > max_cache_size) {
373- uint64_t older;
374- HashMap<String, Cache>::Iterator O = cached.begin ();
375- older = O->value .time_loaded ;
376- HashMap<String, Cache>::Iterator I = O;
377- while (I) {
378- if (I->value .time_loaded < older) {
379- older = I->value .time_loaded ;
380- O = I;
381- }
382- ++I;
383- }
384-
385- if (O != E) { // should never happen..
386- cached.remove (O);
387- }
388- }
389-
390- return E->value .cache ;
391- }
392- };
393-
394333void ScriptEditorQuickOpen::popup_dialog (const Vector<String> &p_functions, bool p_dontclear) {
395334 popup_centered_ratio (0.6 );
396335 if (p_dontclear) {
@@ -4170,7 +4109,6 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
41704109 script_editor_cache.instantiate ();
41714110 script_editor_cache->load (EditorPaths::get_singleton ()->get_project_settings_dir ().path_join (" script_editor_cache.cfg" ));
41724111
4173- completion_cache = memnew (EditorScriptCodeCompletionCache);
41744112 restoring_layout = false ;
41754113 waiting_update_names = false ;
41764114 pending_auto_reload = false ;
@@ -4540,10 +4478,6 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
45404478 _update_online_doc ();
45414479}
45424480
4543- ScriptEditor::~ScriptEditor () {
4544- memdelete (completion_cache);
4545- }
4546-
45474481void ScriptEditorPlugin::_focus_another_editor () {
45484482 if (window_wrapper->get_window_enabled ()) {
45494483 ERR_FAIL_COND (last_editor.is_empty ());
0 commit comments