-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
부산대 Android_김현민 2주차 과제 수정 #72
base: khyeonm
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khyeonm
LGTM~ 과제 수정 PR에서는 마지막 커밋위주로 확인했습니다. 고생많으셨습니다.
val db = this.writableDatabase | ||
private fun insertPharData(db: SQLiteDatabase?) { | ||
val type = "약국" | ||
val name = "약국" | ||
val address = "서울 강남구 대치동" | ||
|
||
for (i in 1..30) { | ||
val name = "$name$i" | ||
val address = "$address $i" | ||
db.execSQL("INSERT INTO $TABLE_PLACE ($COLUMN_TYPE, $COLUMN_NAME, $COLUMN_ADDRESS) VALUES ('$type', '$name', '$address');") | ||
val nameWithIndex = "$name$i" | ||
val addressWithIndex = "$address $i" | ||
db?.execSQL("INSERT INTO $TABLE_PLACE ($COLUMN_TYPE, $COLUMN_NAME, $COLUMN_ADDRESS) VALUES ('$type', '$nameWithIndex', '$addressWithIndex');") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db가 null 인지 체크를 미리해서, early return 시키거나 null일때는 이 메소드가 호출안되도록 하는게 좋을것 같습니다. 왜냐면, db가 null 일때도 loop를 30회 수행하고 있을것이라 무의미한 연산이 수행될것 같네요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래 insertCafeData
메소드도 동일합니다.
어려웠던 점
중점적으로 리뷰해주셨으면 하는 부분
궁금한 점
재제출
KakaoTalk_20240709_175235343.mp4