Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Using std::remove_if is overkill here.
[simgrid.git] / src / bindings / java / jmsg_vm.cpp
index d7e9ea1..d1ca0a7 100644 (file)
@@ -136,11 +136,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_VM_shutdown(JNIEnv *env, jobject jvm
   if (vm) {
     MSG_vm_shutdown(vm);
     auto vmList = &simgrid::vm::VirtualMachineImpl::allVms_;
-    vmList->erase(
-        std::remove_if(vmList->begin(), vmList->end(), [vm](simgrid::s4u::VirtualMachine* it) {
-          return vm == it;
-        }),
-        vmList->end());
+    vmList->erase(std::remove(vmList->begin(), vmList->end(), vm), vmList->end());
   }
 }
 
@@ -174,7 +170,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_VM_getVMByName(JNIEnv* env, jclas
 
   /* get the C string from the java string */
   if (jname == nullptr) {
-    jxbt_throw_null(env, bprintf("No VM can have a null name"));
+    jxbt_throw_null(env, "No VM can have a null name");
     return nullptr;
   }
   const char* name = env->GetStringUTFChars(jname, 0);